Re: [PATCH v2] drivers: net: Replace acpi_bus_get_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 2, 2022 at 5:20 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Tue, 01 Feb 2022 20:58:36 +0100 Rafael J. Wysocki wrote:
> > -     struct bgx *bgx = context;
> > +     struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
> >       struct device *dev = &bgx->pdev->dev;
> > -     struct acpi_device *adev;
> > +     struct bgx *bgx = context;
>
> Compiler says you can't move bgx before dev.

Right, I've obviously missed that.

> Venturing deeper into the bikesheeding territory but I'd leave the
> variable declarations be and move init of adev before the check.
> Matter of preference but calling something that needs to be error
> checked in variable init breaks the usual
>
>         ret = func(some, arguments);
>         if (ret)
>                 goto explosions;
>
> flow.

It doesn't for me, but let me send a v3.

Thanks!

> > -     if (acpi_bus_get_device(handle, &adev))
> > +     if (!adev)
> >               goto out;



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux