Commit bf1b4659 authored by Damien Le Moal's avatar Damien Le Moal Committed by Martin K. Petersen

scsi: sd: Warn if unsupported ZBC device is probed

In sd_probe(), print a warning if CONFIG_BLK_DEV_ZONED is disabled and a
TYPE_ZBC device is found. While at it, use IS_ENABLED() to test if
CONFIG_BLK_DEV_ZONED is enabled instead using of a #ifdef.

Link: https://lore.kernel.org/r/20210128055658.530133-1-damien.lemoal@wdc.comSigned-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d2aacd36
...@@ -3379,10 +3379,12 @@ static int sd_probe(struct device *dev) ...@@ -3379,10 +3379,12 @@ static int sd_probe(struct device *dev)
sdp->type != TYPE_RBC) sdp->type != TYPE_RBC)
goto out; goto out;
#ifndef CONFIG_BLK_DEV_ZONED if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) && sdp->type == TYPE_ZBC) {
if (sdp->type == TYPE_ZBC) sdev_printk(KERN_WARNING, sdp,
"Unsupported ZBC host-managed device.\n");
goto out; goto out;
#endif }
SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp, SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp,
"sd_probe\n")); "sd_probe\n"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment