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] [thread-next>] [day] [month] [year] [list]
Message-ID: <56cc8580-f982-742c-6808-a4d66e39da8b@amd.com>
Date:   Tue, 12 Oct 2021 23:42:30 +0530
From:   Shyam Sundar S K <Shyam-sundar.S-k@....com>
To:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Linux ACPI <linux-acpi@...r.kernel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Elie Morisse <syniurge@...il.com>,
        Nehal Shah <nehal-bakulchandra.shah@....com>,
        linux-i2c@...r.kernel.org
Subject: Re: [PATCH v1 3/7] i2c: i2c-amd-mp2-plat: ACPI: Use ACPI_COMPANION()
 directly



On 10/12/2021 11:14 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael@...nel.org>
> 
> The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION()
> macro and the ACPI handle produced by the former comes from the
> ACPI device object produced by the latter, so it is way more
> straightforward to evaluate the latter directly instead of passing
> the handle produced by the former to acpi_bus_get_device().
> 
> Modify i2c_amd_probe() accordingly (no intentional functional impact).
> 
> Signed-off-by: Rafael J. Wysocki <rafael@...nel.org>

Looks good to me.

Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@....com>

> ---
>  drivers/i2c/busses/i2c-amd-mp2-plat.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Index: linux-pm/drivers/i2c/busses/i2c-amd-mp2-plat.c
> ===================================================================
> --- linux-pm.orig/drivers/i2c/busses/i2c-amd-mp2-plat.c
> +++ linux-pm/drivers/i2c/busses/i2c-amd-mp2-plat.c
> @@ -246,12 +246,11 @@ static int i2c_amd_probe(struct platform
>  {
>  	int ret;
>  	struct amd_i2c_dev *i2c_dev;
> -	acpi_handle handle = ACPI_HANDLE(&pdev->dev);
> -	struct acpi_device *adev;
> +	struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
>  	struct amd_mp2_dev *mp2_dev;
>  	const char *uid;
>  
> -	if (acpi_bus_get_device(handle, &adev))
> +	if (!adev)
>  		return -ENODEV;
>  
>  	/* The ACPI namespace doesn't contain information about which MP2 PCI
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ