Skip to content

Commit 8757609

Browse files
ij-intelbjorn-helgaas
authored andcommitted
scsi: ipr: Do PCI error checks on own line
Instead of "if" conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: "Martin K. Petersen" <[email protected]>
1 parent 910ed62 commit 8757609

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/scsi/ipr.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,12 +761,14 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
761761
static int ipr_save_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg)
762762
{
763763
int pcix_cmd_reg = pci_find_capability(ioa_cfg->pdev, PCI_CAP_ID_PCIX);
764+
int rc;
764765

765766
if (pcix_cmd_reg == 0)
766767
return 0;
767768

768-
if (pci_read_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD,
769-
&ioa_cfg->saved_pcix_cmd_reg) != PCIBIOS_SUCCESSFUL) {
769+
rc = pci_read_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD,
770+
&ioa_cfg->saved_pcix_cmd_reg);
771+
if (rc != PCIBIOS_SUCCESSFUL) {
770772
dev_err(&ioa_cfg->pdev->dev, "Failed to save PCI-X command register\n");
771773
return -EIO;
772774
}
@@ -785,10 +787,12 @@ static int ipr_save_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg)
785787
static int ipr_set_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg)
786788
{
787789
int pcix_cmd_reg = pci_find_capability(ioa_cfg->pdev, PCI_CAP_ID_PCIX);
790+
int rc;
788791

789792
if (pcix_cmd_reg) {
790-
if (pci_write_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD,
791-
ioa_cfg->saved_pcix_cmd_reg) != PCIBIOS_SUCCESSFUL) {
793+
rc = pci_write_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD,
794+
ioa_cfg->saved_pcix_cmd_reg);
795+
if (rc != PCIBIOS_SUCCESSFUL) {
792796
dev_err(&ioa_cfg->pdev->dev, "Failed to setup PCI-X command register\n");
793797
return -EIO;
794798
}

0 commit comments

Comments
 (0)