]> git.itanic.dy.fi Git - linux-stable/commit
PCI: Do error check on own line to split long "if" conditions
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 11 Sep 2023 12:53:52 +0000 (15:53 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 10 Oct 2023 21:40:18 +0000 (16:40 -0500)
commitd15f18053e5cc5576af9e7eef0b2a91169b6326d
tree011dd3464d5b7d4e16b7f37e8c65d0ad5f7baf14
parentc28742447ca9879b52fbaf022ad844f0ffcd749c
PCI: Do error check on own line to split long "if" conditions

Placing PCI error code check inside "if" condition usually results in need
to split lines. Combined with additional conditions the "if" condition
becomes messy.

Convert to the usual error handling pattern with an additional variable to
improve code readability. In addition, reverse the logic in
pci_find_vsec_capability() to get rid of &&.

No functional changes intended.

Link: https://lore.kernel.org/r/20230911125354.25501-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[bhelgaas: PCI_POSSIBLE_ERROR()]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c
drivers/pci/probe.c
drivers/pci/quirks.c