Skip to content

Commit c287424

Browse files
ij-intelbjorn-helgaas
authored andcommitted
atm: iphase: Do PCI error checks on own line
In get_esi() PCI errors are checked inside line-split "if" conditions (in addition to the file not following the coding style). To make the code in get_esi() more readable, fix the coding style and use the usual error handling pattern with a separate variable. In addition, initialization of 'error' variable at declaration is not needed. 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]>
1 parent a1165c5 commit c287424

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

drivers/atm/iphase.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,19 +2291,21 @@ static int get_esi(struct atm_dev *dev)
22912291
static int reset_sar(struct atm_dev *dev)
22922292
{
22932293
IADEV *iadev;
2294-
int i, error = 1;
2294+
int i, error;
22952295
unsigned int pci[64];
22962296

22972297
iadev = INPH_IA_DEV(dev);
2298-
for(i=0; i<64; i++)
2299-
if ((error = pci_read_config_dword(iadev->pci,
2300-
i*4, &pci[i])) != PCIBIOS_SUCCESSFUL)
2301-
return error;
2298+
for (i = 0; i < 64; i++) {
2299+
error = pci_read_config_dword(iadev->pci, i * 4, &pci[i]);
2300+
if (error != PCIBIOS_SUCCESSFUL)
2301+
return error;
2302+
}
23022303
writel(0, iadev->reg+IPHASE5575_EXT_RESET);
2303-
for(i=0; i<64; i++)
2304-
if ((error = pci_write_config_dword(iadev->pci,
2305-
i*4, pci[i])) != PCIBIOS_SUCCESSFUL)
2306-
return error;
2304+
for (i = 0; i < 64; i++) {
2305+
error = pci_write_config_dword(iadev->pci, i * 4, pci[i]);
2306+
if (error != PCIBIOS_SUCCESSFUL)
2307+
return error;
2308+
}
23072309
udelay(5);
23082310
return 0;
23092311
}

0 commit comments

Comments
 (0)