* [PATCH] scsi: ipr: Convert ipr_probe_ioa_part2 as void
@ 2023-01-08 15:18 Deepak R Varma
0 siblings, 0 replies; only message in thread
From: Deepak R Varma @ 2023-01-08 15:18 UTC (permalink / raw)
To: Brian King, James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel
Cc: Saurabh Singh Sengar, Praveen Kumar
Convert function ipr_probe_ioa_part2() to return void instead
of int since the current implementation always returns 0 to the caller.
The transformation also eliminates the dead code when calling
ipr_probe_ioa_part2() function.
Issue identified using returnvar Coccinelle semantic patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
drivers/scsi/ipr.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 2022ffb45041..2e3e12c83277 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -9504,12 +9504,9 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev,
* Description: This is the second phase of adapter initialization
* This function takes care of initilizing the adapter to the point
* where it can accept new commands.
- * Return value:
- * 0 on success / -EIO on failure
**/
-static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
+static void ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
{
- int rc = 0;
unsigned long host_lock_flags = 0;
ENTER;
@@ -9525,7 +9522,6 @@ static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
LEAVE;
- return rc;
}
/**
@@ -10568,12 +10564,7 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
return rc;
ioa_cfg = pci_get_drvdata(pdev);
- rc = ipr_probe_ioa_part2(ioa_cfg);
-
- if (rc) {
- __ipr_remove(pdev);
- return rc;
- }
+ ipr_probe_ioa_part2(ioa_cfg);
rc = scsi_add_host(ioa_cfg->host, &pdev->dev);
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-08 15:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-08 15:18 [PATCH] scsi: ipr: Convert ipr_probe_ioa_part2 as void Deepak R Varma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®