Skip to content

Commit 3a2d1ef

Browse files
hidrv4martinkpetersen
authored andcommitted
scsi: ipr: Make ipr_probe_ioa_part2() return void
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. Link: https://lore.kernel.org/r/Y7rvQyMOGcPKPTv8@ubun2204.myguest.virtualbox.org Signed-off-by: Deepak R Varma <drv@mailo.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 26a02d9 commit 3a2d1ef

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

drivers/scsi/ipr.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9500,11 +9500,10 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev,
95009500
* This function takes care of initilizing the adapter to the point
95019501
* where it can accept new commands.
95029502
* Return value:
9503-
* 0 on success / -EIO on failure
9503+
* none
95049504
**/
9505-
static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
9505+
static void ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
95069506
{
9507-
int rc = 0;
95089507
unsigned long host_lock_flags = 0;
95099508

95109509
ENTER;
@@ -9520,7 +9519,6 @@ static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
95209519
spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
95219520

95229521
LEAVE;
9523-
return rc;
95249522
}
95259523

95269524
/**
@@ -10563,12 +10561,7 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
1056310561
return rc;
1056410562

1056510563
ioa_cfg = pci_get_drvdata(pdev);
10566-
rc = ipr_probe_ioa_part2(ioa_cfg);
10567-
10568-
if (rc) {
10569-
__ipr_remove(pdev);
10570-
return rc;
10571-
}
10564+
ipr_probe_ioa_part2(ioa_cfg);
1057210565

1057310566
rc = scsi_add_host(ioa_cfg->host, &pdev->dev);
1057410567

0 commit comments

Comments
 (0)