lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YfmJmgE/KuS8G92w@lunn.ch>
Date:   Tue, 1 Feb 2022 20:27:22 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:     Sunil Goutham <sgoutham@...vell.com>,
        Iyappan Subramanian <iyappan@...amperecomputing.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Keyur Chudgar <keyur@...amperecomputing.com>,
        Quan Nguyen <quan@...amperecomputing.com>,
        Heiner Kallweit <hkallweit1@...il.com>, netdev@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>,
        Linux ACPI <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH] drivers: net: Replace acpi_bus_get_device()

On Tue, Feb 01, 2022 at 08:07:08PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> Replace acpi_bus_get_device() that is going to be dropped with
> acpi_fetch_acpi_dev().
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>  drivers/net/ethernet/cavium/thunder/thunder_bgx.c |    4 ++--
>  drivers/net/fjes/fjes_main.c                      |   10 +++-------
>  drivers/net/mdio/mdio-xgene.c                     |    8 +++-----
>  3 files changed, 8 insertions(+), 14 deletions(-)
> 
> Index: linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> ===================================================================
> --- linux-pm.orig/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> +++ linux-pm/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> @@ -1407,9 +1407,9 @@ static acpi_status bgx_acpi_register_phy
>  {
>  	struct bgx *bgx = context;
>  	struct device *dev = &bgx->pdev->dev;
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = acpi_fetch_acpi_dev(handle);

Hi Rafael

Since this is part of the networking subsystem, reverse christmas tree
applies. Yes, this driver gets is wrong here, but we should not make
it even worse. Please put this variable first.

> Index: linux-pm/drivers/net/mdio/mdio-xgene.c
> ===================================================================
> --- linux-pm.orig/drivers/net/mdio/mdio-xgene.c
> +++ linux-pm/drivers/net/mdio/mdio-xgene.c
> @@ -280,15 +280,13 @@ static acpi_status acpi_register_phy(acp
>  				     void *context, void **ret)
>  {
>  	struct mii_bus *mdio = context;
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = acpi_fetch_acpi_dev(handle);

Here as well please.

With those changes, you can add my Reviewed-by:

Thanks
     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ