scsi: libsas: Remove redundant assignment to variable res
authorColin Ian King <colin.king@canonical.com>
Wed, 22 Jul 2020 15:44:04 +0000 (16:44 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 25 Jul 2020 02:09:56 +0000 (22:09 -0400)
The variable 'res' is being initialized with a value that is never read and
it is being updated later with a new value. The initialization is redundant
and can be removed.

Link: https://lore.kernel.org/r/20200722154404.959267-1-colin.king@canonical.com
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Unused value")

drivers/scsi/libsas/sas_expander.c

index ab671cdd4cfb090c3797f6d18b8b2d4278e2c11d..b7d1b1ea185d773998aee67024abc054ec97da58 100644 (file)
@@ -427,7 +427,7 @@ out_err:
 static int sas_expander_discover(struct domain_device *dev)
 {
        struct expander_device *ex = &dev->ex_dev;
-       int res = -ENOMEM;
+       int res;
 
        ex->ex_phy = kcalloc(ex->num_phys, sizeof(*ex->ex_phy), GFP_KERNEL);
        if (!ex->ex_phy)