Hi Luis,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on block/for-next]
[also build test ERROR on mkp-scsi/for-next scsi/for-next v5.14-rc1 next-20210715]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Luis-Chamberlain/block-add_disk-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: nds32-randconfig-r036-20210715 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 10.3.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://github.com/0day-ci/linux/commit/c1a87f26cc4c93ee87a100d4ed4103489...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Luis-Chamberlain/block-add_disk-driver-conversions-__register_blkdev/20210716-050317
git checkout c1a87f26cc4c93ee87a100d4ed4103489f9e8e2d
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir
ARCH=nds32 SHELL=/bin/bash drivers/md/ drivers/scsi/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/scsi/sd.c: In function 'sd_probe':
> drivers/scsi/sd.c:3489:8: error: void value not ignored as it
ought to be
3489 | error = device_add_disk(dev, gd, NULL);
| ^
vim +3489 drivers/scsi/sd.c
3362
3363 /**
3364 * sd_probe - called during driver initialization and whenever a
3365 * new scsi device is attached to the system. It is called once
3366 * for each scsi device (not just disks) present.
3367 * @dev: pointer to device object
3368 *
3369 * Returns 0 if successful (or not interested in this scsi device
3370 * (e.g. scanner)); 1 when there is an error.
3371 *
3372 * Note: this function is invoked from the scsi mid-level.
3373 * This function sets up the mapping between a given
3374 * <host,channel,id,lun> (found in sdp) and new device name
3375 * (e.g. /dev/sda). More precisely it is the block device major
3376 * and minor number that is chosen here.
3377 *
3378 * Assume sd_probe is not re-entrant (for time being)
3379 * Also think about sd_probe() and sd_remove() running coincidentally.
3380 **/
3381 static int sd_probe(struct device *dev)
3382 {
3383 struct scsi_device *sdp = to_scsi_device(dev);
3384 struct scsi_disk *sdkp;
3385 struct gendisk *gd;
3386 int index;
3387 int error;
3388
3389 scsi_autopm_get_device(sdp);
3390 error = -ENODEV;
3391 if (sdp->type != TYPE_DISK &&
3392 sdp->type != TYPE_ZBC &&
3393 sdp->type != TYPE_MOD &&
3394 sdp->type != TYPE_RBC)
3395 goto out;
3396
3397 if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) && sdp->type == TYPE_ZBC) {
3398 sdev_printk(KERN_WARNING, sdp,
3399 "Unsupported ZBC host-managed device.\n");
3400 goto out;
3401 }
3402
3403 SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp,
3404 "sd_probe\n"));
3405
3406 error = -ENOMEM;
3407 sdkp = kzalloc(sizeof(*sdkp), GFP_KERNEL);
3408 if (!sdkp)
3409 goto out;
3410
3411 gd = alloc_disk(SD_MINORS);
3412 if (!gd)
3413 goto out_free;
3414
3415 index = ida_alloc(&sd_index_ida, GFP_KERNEL);
3416 if (index < 0) {
3417 sdev_printk(KERN_WARNING, sdp, "sd_probe: memory exhausted.\n");
3418 goto out_put;
3419 }
3420
3421 error = sd_format_disk_name("sd", index, gd->disk_name,
DISK_NAME_LEN);
3422 if (error) {
3423 sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name length
exceeded.\n");
3424 goto out_free_index;
3425 }
3426
3427 sdkp->device = sdp;
3428 sdkp->driver = &sd_template;
3429 sdkp->disk = gd;
3430 sdkp->index = index;
3431 sdkp->max_retries = SD_MAX_RETRIES;
3432 atomic_set(&sdkp->openers, 0);
3433 atomic_set(&sdkp->device->ioerr_cnt, 0);
3434
3435 if (!sdp->request_queue->rq_timeout) {
3436 if (sdp->type != TYPE_MOD)
3437 blk_queue_rq_timeout(sdp->request_queue, SD_TIMEOUT);
3438 else
3439 blk_queue_rq_timeout(sdp->request_queue,
3440 SD_MOD_TIMEOUT);
3441 }
3442
3443 device_initialize(&sdkp->dev);
3444 sdkp->dev.parent = dev;
3445 sdkp->dev.class = &sd_disk_class;
3446 dev_set_name(&sdkp->dev, "%s", dev_name(dev));
3447
3448 error = device_add(&sdkp->dev);
3449 if (error)
3450 goto out_free_index;
3451
3452 get_device(dev);
3453 dev_set_drvdata(dev, sdkp);
3454
3455 gd->major = sd_major((index & 0xf0) >> 4);
3456 gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
3457
3458 gd->fops = &sd_fops;
3459 gd->private_data = &sdkp->driver;
3460 gd->queue = sdkp->device->request_queue;
3461
3462 /* defaults, until the device tells us otherwise */
3463 sdp->sector_size = 512;
3464 sdkp->capacity = 0;
3465 sdkp->media_present = 1;
3466 sdkp->write_prot = 0;
3467 sdkp->cache_override = 0;
3468 sdkp->WCE = 0;
3469 sdkp->RCD = 0;
3470 sdkp->ATO = 0;
3471 sdkp->first_scan = 1;
3472 sdkp->max_medium_access_timeouts = SD_MAX_MEDIUM_TIMEOUTS;
3473
3474 sd_revalidate_disk(gd);
3475
3476 gd->flags = GENHD_FL_EXT_DEVT;
3477 if (sdp->removable) {
3478 gd->flags |= GENHD_FL_REMOVABLE;
3479 gd->events |= DISK_EVENT_MEDIA_CHANGE;
3480 gd->event_flags = DISK_EVENT_FLAG_POLL | DISK_EVENT_FLAG_UEVENT;
3481 }
3482
3483 blk_pm_runtime_init(sdp->request_queue, dev);
3484 if (sdp->rpm_autosuspend) {
3485 pm_runtime_set_autosuspend_delay(dev,
3486 sdp->host->hostt->rpm_autosuspend_delay);
3487 }
3488
3489 error = device_add_disk(dev, gd, NULL);
3490 if
(error)
3491 goto out_free_index;
3492
3493 if (sdkp->capacity)
3494 sd_dif_config_host(sdkp);
3495
3496 sd_revalidate_disk(gd);
3497
3498 if (sdkp->security) {
3499 sdkp->opal_dev = init_opal_dev(sdkp, &sd_sec_submit);
3500 if (sdkp->opal_dev)
3501 sd_printk(KERN_NOTICE, sdkp, "supports TCG Opal\n");
3502 }
3503
3504 sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
3505 sdp->removable ? "removable " : "");
3506 scsi_autopm_put_device(sdp);
3507
3508 return 0;
3509
3510 out_free_index:
3511 ida_free(&sd_index_ida, index);
3512 out_put:
3513 blk_cleanup_disk(gd);
3514 out_free:
3515 sd_zbc_release_disk(sdkp);
3516 kfree(sdkp);
3517 out:
3518 scsi_autopm_put_device(sdp);
3519 return error;
3520 }
3521
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org