[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202112112312.TqjBbfUS-lkp@intel.com>
Date: Sat, 11 Dec 2021 23:42:19 +0800
From: kernel test robot <lkp@...el.com>
To: Christoph Hellwig <hch@....de>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>
Subject: [axboe-block:block-5.16 14/19] drivers/mtd/mtd_blkdevs.c:361:30:
error: 'GENHD_FL_NO_PART' undeclared; did you mean 'GENHD_FL_NO_PART_SCAN'?
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git block-5.16
head: 5eff363838654790f67f4bd564c5782967f67bcc
commit: 776b54e97a7d993ba23696e032426d5dea5bbe70 [14/19] mtd_blkdevs: don't scan partitions for plain mtdblock
config: arm-pxa3xx_defconfig (https://download.01.org/0day-ci/archive/20211211/202112112312.TqjBbfUS-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=776b54e97a7d993ba23696e032426d5dea5bbe70
git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags axboe-block block-5.16
git checkout 776b54e97a7d993ba23696e032426d5dea5bbe70
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Note: the axboe-block/block-5.16 HEAD 5eff363838654790f67f4bd564c5782967f67bcc builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
drivers/mtd/mtd_blkdevs.c: In function 'add_mtd_blktrans_dev':
>> drivers/mtd/mtd_blkdevs.c:361:30: error: 'GENHD_FL_NO_PART' undeclared (first use in this function); did you mean 'GENHD_FL_NO_PART_SCAN'?
361 | gd->flags |= GENHD_FL_NO_PART;
| ^~~~~~~~~~~~~~~~
| GENHD_FL_NO_PART_SCAN
drivers/mtd/mtd_blkdevs.c:361:30: note: each undeclared identifier is reported only once for each function it appears in
vim +361 drivers/mtd/mtd_blkdevs.c
274
275 int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
276 {
277 struct mtd_blktrans_ops *tr = new->tr;
278 struct mtd_blktrans_dev *d;
279 int last_devnum = -1;
280 struct gendisk *gd;
281 int ret;
282
283 lockdep_assert_held(&mtd_table_mutex);
284
285 list_for_each_entry(d, &tr->devs, list) {
286 if (new->devnum == -1) {
287 /* Use first free number */
288 if (d->devnum != last_devnum+1) {
289 /* Found a free devnum. Plug it in here */
290 new->devnum = last_devnum+1;
291 list_add_tail(&new->list, &d->list);
292 goto added;
293 }
294 } else if (d->devnum == new->devnum) {
295 /* Required number taken */
296 return -EBUSY;
297 } else if (d->devnum > new->devnum) {
298 /* Required number was free */
299 list_add_tail(&new->list, &d->list);
300 goto added;
301 }
302 last_devnum = d->devnum;
303 }
304
305 ret = -EBUSY;
306 if (new->devnum == -1)
307 new->devnum = last_devnum+1;
308
309 /* Check that the device and any partitions will get valid
310 * minor numbers and that the disk naming code below can cope
311 * with this number. */
312 if (new->devnum > (MINORMASK >> tr->part_bits) ||
313 (tr->part_bits && new->devnum >= 27 * 26))
314 return ret;
315
316 list_add_tail(&new->list, &tr->devs);
317 added:
318
319 mutex_init(&new->lock);
320 kref_init(&new->ref);
321 if (!tr->writesect)
322 new->readonly = 1;
323
324 ret = -ENOMEM;
325 new->tag_set = kzalloc(sizeof(*new->tag_set), GFP_KERNEL);
326 if (!new->tag_set)
327 goto out_list_del;
328
329 ret = blk_mq_alloc_sq_tag_set(new->tag_set, &mtd_mq_ops, 2,
330 BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING);
331 if (ret)
332 goto out_kfree_tag_set;
333
334 /* Create gendisk */
335 gd = blk_mq_alloc_disk(new->tag_set, new);
336 if (IS_ERR(gd)) {
337 ret = PTR_ERR(gd);
338 goto out_free_tag_set;
339 }
340
341 new->disk = gd;
342 new->rq = new->disk->queue;
343 gd->private_data = new;
344 gd->major = tr->major;
345 gd->first_minor = (new->devnum) << tr->part_bits;
346 gd->minors = 1 << tr->part_bits;
347 gd->fops = &mtd_block_ops;
348
349 if (tr->part_bits) {
350 if (new->devnum < 26)
351 snprintf(gd->disk_name, sizeof(gd->disk_name),
352 "%s%c", tr->name, 'a' + new->devnum);
353 else
354 snprintf(gd->disk_name, sizeof(gd->disk_name),
355 "%s%c%c", tr->name,
356 'a' - 1 + new->devnum / 26,
357 'a' + new->devnum % 26);
358 } else {
359 snprintf(gd->disk_name, sizeof(gd->disk_name),
360 "%s%d", tr->name, new->devnum);
> 361 gd->flags |= GENHD_FL_NO_PART;
362 }
363
364 set_capacity(gd, ((u64)new->size * tr->blksize) >> 9);
365
366 /* Create the request queue */
367 spin_lock_init(&new->queue_lock);
368 INIT_LIST_HEAD(&new->rq_list);
369
370 if (tr->flush)
371 blk_queue_write_cache(new->rq, true, false);
372
373 blk_queue_logical_block_size(new->rq, tr->blksize);
374
375 blk_queue_flag_set(QUEUE_FLAG_NONROT, new->rq);
376 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, new->rq);
377
378 if (tr->discard) {
379 blk_queue_flag_set(QUEUE_FLAG_DISCARD, new->rq);
380 blk_queue_max_discard_sectors(new->rq, UINT_MAX);
381 new->rq->limits.discard_granularity = tr->blksize;
382 }
383
384 gd->queue = new->rq;
385
386 if (new->readonly)
387 set_disk_ro(gd, 1);
388
389 ret = device_add_disk(&new->mtd->dev, gd, NULL);
390 if (ret)
391 goto out_cleanup_disk;
392
393 if (new->disk_attributes) {
394 ret = sysfs_create_group(&disk_to_dev(gd)->kobj,
395 new->disk_attributes);
396 WARN_ON(ret);
397 }
398 return 0;
399
400 out_cleanup_disk:
401 blk_cleanup_disk(new->disk);
402 out_free_tag_set:
403 blk_mq_free_tag_set(new->tag_set);
404 out_kfree_tag_set:
405 kfree(new->tag_set);
406 out_list_del:
407 list_del(&new->list);
408 return ret;
409 }
410
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists