lkml.org 
[lkml]   [2023]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scsi: hpsa: Remove unreachable code
Date
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@red-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
\
 
 \ /
  Last update: 2023-04-17 17:44    [W:0.020 / U:1.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site