scsi: raid_attrs: fix unused variable warning
PATCH 1/1 scsi: raid_attrs: fix unused variable warning
I ran into a new warning on randconfig kernels:
drivers/scsi/raid_class.c: In function 'raid_match':drivers/scsi/raid_class.c:64:24: error: unused variable 'i' [-Werror=unused-variable]
This looks like a very old problem that for some reason was very hard to run into, but it is very easy to fix, by replacing the incorrect #ifdef with a simpler IS_ENABLED() check.
--- drivers/scsi/raid_class.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/raid_class.c +1 -3
@@ -63,8 +63,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev)* emulated RAID devices, so start with SCSI */ struct raid_internal *i =ac_to_raid_internal (cont); -#if defined(CONFIG_SCSI ) || defined(CONFIG_SCSI_MODULE ) -if (scsi_is_sdev_device (dev)) { +if (IS_ENABLED (CONFIG_SCSI ) &&scsi_is_sdev_device (dev)) {struct scsi_device *sdev =to_scsi_device (dev);if (i->f->cookie != sdev->host->hostt)
@@ -72,7 +71,6 @@ static int raid_match(struct attribute_container *cont, struct device *dev)return i->f->is_raid (dev); } -#endif /* FIXME: look at other subsystems too */ return 0 ; }
Signature · 1 line
2.18.0
Martin K. Petersen
AppliedArnd,
Quoted 8 lines
I ran into a new warning on randconfig kernels:
drivers/scsi/raid_class.c: In function 'raid_match':drivers/scsi/raid_class.c:64:24: error: unused variable 'i' [-Werror=unused-variable]This looks like a very old problem that for some reason was very hard to run into, but it is very easy to fix, by replacing the incorrect #ifdef with a simpler
IS_ENABLED()check.
Applied to 4.20/scsi-queue. Thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering