From: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
To: bhelgaas@google.com
Cc: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] PCI: remove type return
Date: Sat, 3 Aug 2024 11:04:42 -0300 [thread overview]
Message-ID: <20240803140443.23036-1-trintaeoitogc@gmail.com> (raw)
I can see that the function pci_hp_add_brigde have a int return propagation.
But in the drivers that pci_hp_add_bridge is called, your return never is
cheked.
This make me a think that the add bridge for pci hotplug drivers is not crucial
for functionaly and your failed only should show a message in logs.
Then, I maked this patch for remove your return propagation for this moment.
---
drivers/pci/pci.h | 2 +-
drivers/pci/probe.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 79c8398f3938..a35dbfd89961 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -189,7 +189,7 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
#endif
/* Functions for PCI Hotplug drivers to use */
-int pci_hp_add_bridge(struct pci_dev *dev);
+void pci_hp_add_bridge(struct pci_dev *dev);
#if defined(CONFIG_SYSFS) && defined(HAVE_PCI_LEGACY)
void pci_create_legacy_files(struct pci_bus *bus);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b14b9876c030..b13c4c912eb1 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -3352,7 +3352,7 @@ void __init pci_sort_breadthfirst(void)
bus_sort_breadthfirst(&pci_bus_type, &pci_sort_bf_cmp);
}
-int pci_hp_add_bridge(struct pci_dev *dev)
+void pci_hp_add_bridge(struct pci_dev *dev)
{
struct pci_bus *parent = dev->bus;
int busnr, start = parent->busn_res.start;
@@ -3365,7 +3365,7 @@ int pci_hp_add_bridge(struct pci_dev *dev)
}
if (busnr-- > end) {
pci_err(dev, "No bus number available for hot-added bridge\n");
- return -1;
+ return;
}
/* Scan bridges that are already configured */
@@ -3381,8 +3381,7 @@ int pci_hp_add_bridge(struct pci_dev *dev)
pci_scan_bridge_extend(parent, dev, busnr, available_buses, 1);
if (!dev->subordinate)
- return -1;
+ pci_err(dev, "No bus subordinate");
- return 0;
}
EXPORT_SYMBOL_GPL(pci_hp_add_bridge);
--
2.46.0
next reply other threads:[~2024-08-03 14:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-03 14:04 Guilherme Giacomo Simoes [this message]
2024-08-06 15:11 ` [PATCH] PCI: remove type return Ilpo Järvinen
2024-08-06 20:54 ` Guilherme Giácomo Simões
2024-08-06 21:36 ` Bjorn Helgaas
2024-08-08 21:05 ` Guilherme Giácomo Simões
2024-08-09 12:44 ` Guilherme Giácomo Simões
2024-08-09 18:14 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240803140443.23036-1-trintaeoitogc@gmail.com \
--to=trintaeoitogc@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox