Patch "scsi: raid_attrs: fix unused variable warning" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: raid_attrs: fix unused variable warning

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-raid_attrs-fix-unused-variable-warning.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7c5e1faa7443e15c4b71c5826a691c2f81c41a38
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Fri Dec 14 23:10:07 2018 +0100

    scsi: raid_attrs: fix unused variable warning
    
    [ Upstream commit 0eeec01488da9b1403c8c29e73eacac8af9e4bf2 ]
    
    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.
    
    Fixes: fac829fdcaf4 ("[SCSI] raid_attrs: fix dependency problems")
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>

diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c
index 2c146b44d95fc..cddd78893b46c 100644
--- a/drivers/scsi/raid_class.c
+++ b/drivers/scsi/raid_class.c
@@ -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;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux