[PATCH] scsi: hpsa: Remove unreachable code

From: Artem Chernyshev
Date: Mon Apr 17 2023 - 11:43:37 EST


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@xxxxxxxxxxx>
---
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