[PATCH] bus: fix code unused

David Marchand david.marchand at redhat.com
Wed May 18 14:07:07 CEST 2022


On Tue, May 17, 2022 at 3:54 AM taoyunxiang at cmss.chinamobile.com
<taoyunxiang at cmss.chinamobile.com> wrote:
> >> @@ -143,7 +143,7 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev)
> >>         if (ret)
> >>                 goto err_devarg;
> >>
> >> -       if (da->bus->plug == NULL) {
> >> +       if (da->bus->plug != 0) {
>
>
>
> >The current (before patch) check is correct: it is allowed that a bus
> >does not support hotplug.
> >Inverting this check as you propose breaks hotplug.
>
> "da->bus->plug" will call pci_plug and  pci_probe_all_drivers in pci_common.c , is it right ?

Checking for da->bus->plug value is different from calling da->bus->plug(dev).

>
> The pci_probe_all_drivers will never return NULL,  so the check and related code will not go throuth,
> no matter the plug is ok or not.

This check is needed, and is correct in its current form.


Thanks.

-- 
David Marchand



More information about the dev mailing list