Skip to content

Commit

Permalink
scsi: libsas: Remove redundant assignment to variable res
Browse files Browse the repository at this point in the history
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")
  • Loading branch information
Colin Ian King authored and Martin K. Petersen committed Jul 25, 2020
1 parent 3865337 commit 55eb809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ int sas_ex_phy_discover(struct domain_device *dev, int single)
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)
Expand Down

0 comments on commit 55eb809

Please sign in to comment.