lkml.org 
[lkml]   [2022]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] drivers: net: Replace acpi_bus_get_device()
    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.

    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.

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

    \
     
     \ /
      Last update: 2022-02-02 05:20    [W:3.255 / U:1.564 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site