From: Colin Ian King Date: Wed, 22 Jul 2020 15:44:04 +0000 (+0100) Subject: scsi: libsas: Remove redundant assignment to variable res X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=55eb809f5e1c6d2a57e4c24a574fe09065e62534;p=linux.git scsi: libsas: Remove redundant assignment to variable res 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 Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen Addresses-Coverity: ("Unused value") --- diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index ab671cdd4cfb0..b7d1b1ea185d7 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -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)