[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230417150757.62902-1-artem.chernyshev@red-soft.ru>
Date: Mon, 17 Apr 2023 18:07:57 +0300
From: Artem Chernyshev <artem.chernyshev@...-soft.ru>
To: Don Brace <don.brace@...rochip.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>
Cc: Artem Chernyshev <artem.chernyshev@...-soft.ru>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
storagedev@...rochip.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: [PATCH] scsi: hpsa: Remove unreachable code
hpsa_lookup_board_id() can't return negative value, so we can
remove redundant if-statement
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c8cd71f1f32a ("scsi: hpsa: Remove 'hpsa_allow_any' module option")
Signed-off-by: Artem Chernyshev <artem.chernyshev@...-soft.ru>
---
drivers/scsi/hpsa.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index f6da34850af9..caf04295efac 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -7871,8 +7871,6 @@ static int hpsa_pci_init(struct ctlr_info *h)
bool legacy_board;
prod_index = hpsa_lookup_board_id(h->pdev, &h->board_id, &legacy_board);
- if (prod_index < 0)
- return prod_index;
h->product_name = products[prod_index].product_name;
h->access = *(products[prod_index].access);
h->legacy_board = legacy_board;
@@ -8670,12 +8668,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (number_of_controllers == 0)
printk(KERN_INFO DRIVER_NAME "\n");
- rc = hpsa_lookup_board_id(pdev, &board_id, NULL);
- if (rc < 0) {
- dev_warn(&pdev->dev, "Board ID not found\n");
- return rc;
- }
-
+ hpsa_lookup_board_id(pdev, &board_id, NULL);
rc = hpsa_init_reset_devices(pdev, board_id);
if (rc) {
if (rc != -ENOTSUPP)
--
2.40.0
Powered by blists - more mailing lists