* [PATCH] pci: ibmphp: add check of return value from pci_hp_register()
@ 2019-06-02 14:30 Emanuel Bennici
2019-06-05 8:32 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Bennici @ 2019-06-02 14:30 UTC (permalink / raw)
To: linux-kernel
Cc: Bjorn Helgaas, Joe Perches, Andy Shevchenko, Lukas Wunner,
Tyrel Datwyler, Sebastian Ott
Check the return value of pci_hp_register() in Function
ebda_rsrc_controller()
Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com>
---
drivers/pci/hotplug/ibmphp_ebda.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 11a2661dc062..7e523ce071b3 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -896,10 +896,17 @@ static int __init ebda_rsrc_controller(void)
} /* each hpc */
+ int result = 0;
list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
snprintf(name, SLOT_NAME_SIZE, "%s", create_file_name(tmp_slot));
- pci_hp_register(&tmp_slot->hotplug_slot,
- pci_find_bus(0, tmp_slot->bus), tmp_slot->device, name);
+ result = pci_hp_register(&tmp_slot->hotplug_slot,
+ pci_find_bus(0, tmp_slot->bus),
+ tmp_slot->device, name);
+
+ if (result) {
+ err("pci_hp_register failed with error %d\n", result);
+ goto error;
+ }
}
print_ebda_hpc();
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pci: ibmphp: add check of return value from pci_hp_register()
2019-06-02 14:30 [PATCH] pci: ibmphp: add check of return value from pci_hp_register() Emanuel Bennici
@ 2019-06-05 8:32 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2019-06-05 8:32 UTC (permalink / raw)
To: benniciemanuel78
Cc: Linux Kernel Mailing List, Bjorn Helgaas, Joe Perches,
Lukas Wunner, Tyrel Datwyler, Sebastian Ott
On Sun, Jun 2, 2019 at 5:30 PM Emanuel Bennici
<benniciemanuel78@gmail.com> wrote:
>
> Check the return value of pci_hp_register() in Function
> ebda_rsrc_controller()
>
Maybe this is correct, maybe not.
You are changing behaviour of the function.
How did you test this?
> Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com>
> ---
> drivers/pci/hotplug/ibmphp_ebda.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
> index 11a2661dc062..7e523ce071b3 100644
> --- a/drivers/pci/hotplug/ibmphp_ebda.c
> +++ b/drivers/pci/hotplug/ibmphp_ebda.c
> @@ -896,10 +896,17 @@ static int __init ebda_rsrc_controller(void)
>
> } /* each hpc */
>
> + int result = 0;
> list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
> snprintf(name, SLOT_NAME_SIZE, "%s", create_file_name(tmp_slot));
> - pci_hp_register(&tmp_slot->hotplug_slot,
> - pci_find_bus(0, tmp_slot->bus), tmp_slot->device, name);
> + result = pci_hp_register(&tmp_slot->hotplug_slot,
> + pci_find_bus(0, tmp_slot->bus),
> + tmp_slot->device, name);
> +
> + if (result) {
> + err("pci_hp_register failed with error %d\n", result);
> + goto error;
> + }
> }
>
> print_ebda_hpc();
> --
> 2.19.1
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-05 8:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-02 14:30 [PATCH] pci: ibmphp: add check of return value from pci_hp_register() Emanuel Bennici
2019-06-05 8:32 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.