* [PATCH] PCI: Fix coding style in pci_sort_bf_cmp()
@ 2026-07-30 1:38 Jiwon Kang
2026-07-30 1:41 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Jiwon Kang @ 2026-07-30 1:38 UTC (permalink / raw)
To: bhelgaas; +Cc: linux-pci, linux-kernel, Jiwon Kang
Split single-line if/else statements with trailing
return into separate lines
Signed-off-by: Jiwon Kang <kkjiwon04@gmail.com>
---
drivers/pci/probe.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index dd0abbc63e18d..f5972c2c50340 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3527,14 +3527,20 @@ static int __init pci_sort_bf_cmp(const struct device *d_a,
const struct pci_dev *a = to_pci_dev(d_a);
const struct pci_dev *b = to_pci_dev(d_b);
- if (pci_domain_nr(a->bus) < pci_domain_nr(b->bus)) return -1;
- else if (pci_domain_nr(a->bus) > pci_domain_nr(b->bus)) return 1;
+ if (pci_domain_nr(a->bus) < pci_domain_nr(b->bus))
+ return -1;
+ else if (pci_domain_nr(a->bus) > pci_domain_nr(b->bus))
+ return 1;
- if (a->bus->number < b->bus->number) return -1;
- else if (a->bus->number > b->bus->number) return 1;
+ if (a->bus->number < b->bus->number)
+ return -1;
+ else if (a->bus->number > b->bus->number)
+ return 1;
- if (a->devfn < b->devfn) return -1;
- else if (a->devfn > b->devfn) return 1;
+ if (a->devfn < b->devfn)
+ return -1;
+ else if (a->devfn > b->devfn)
+ return 1;
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-30 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 1:38 [PATCH] PCI: Fix coding style in pci_sort_bf_cmp() Jiwon Kang
2026-07-30 1:41 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox