Skip to content

Commit a1165c5

Browse files
ij-intelbjorn-helgaas
authored andcommitted
sh: pci: Do PCI error check on own line
Instead of an "if" condition with a line split, 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]> [bhelgaas: u16 vid, PCI_POSSIBLE_ERROR()] Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: John Paul Adrian Glaubitz <[email protected]>
1 parent 7d52f53 commit a1165c5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arch/sh/drivers/pci/common.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,21 @@ int __init pci_is_66mhz_capable(struct pci_channel *hose,
5050
int top_bus, int current_bus)
5151
{
5252
u32 pci_devfn;
53-
unsigned short vid;
53+
u16 vid;
5454
int cap66 = -1;
5555
u16 stat;
56+
int ret;
5657

5758
pr_info("PCI: Checking 66MHz capabilities...\n");
5859

5960
for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
6061
if (PCI_FUNC(pci_devfn))
6162
continue;
62-
if (early_read_config_word(hose, top_bus, current_bus,
63-
pci_devfn, PCI_VENDOR_ID, &vid) !=
64-
PCIBIOS_SUCCESSFUL)
63+
ret = early_read_config_word(hose, top_bus, current_bus,
64+
pci_devfn, PCI_VENDOR_ID, &vid);
65+
if (ret != PCIBIOS_SUCCESSFUL)
6566
continue;
66-
if (vid == 0xffff)
67+
if (PCI_POSSIBLE_ERROR(vid))
6768
continue;
6869

6970
/* check 66MHz capability */

0 commit comments

Comments
 (0)