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: <20241026120730.199f1465@jic23-huawei>
Date: Sat, 26 Oct 2024 12:07:30 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>, Marius Cristea
 <marius.cristea@...rochip.com>, Trevor Gamblin <tgamblin@...libre.com>,
 Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@....com>, Hans de Goede
 <hdegoede@...hat.com>, linux-iio@...r.kernel.org,
 linux-kernel@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>, Andy
 Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v3 04/24] iio: acpi: Improve
 iio_read_acpi_mount_matrix()

On Thu, 24 Oct 2024 22:04:53 +0300
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:

> From: Andy Shevchenko <andy.shevchenko@...il.com>
> 
> By using ACPI_HANDLE() the handler argument can be retrieved directly.
> Replace ACPI_COMPANION() + dereference with ACPI_HANDLE().
> 
> Reviewed-by: Hans de Goede <hdegoede@...hat.com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
There are two of you?  That explains so many things ;)

Anyhow, whilst a little unusual fair enough that you sent this with different
hats on.

Applied.


> ---
>  drivers/iio/industrialio-acpi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-acpi.c b/drivers/iio/industrialio-acpi.c
> index 981b75d40780..1e46908f9534 100644
> --- a/drivers/iio/industrialio-acpi.c
> +++ b/drivers/iio/industrialio-acpi.c
> @@ -28,17 +28,21 @@ bool iio_read_acpi_mount_matrix(struct device *dev,
>  				char *acpi_method)
>  {
>  	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
> -	struct acpi_device *adev = ACPI_COMPANION(dev);
>  	char *str;
>  	union acpi_object *obj, *elements;
> +	acpi_handle handle;
>  	acpi_status status;
>  	int i, j, val[3];
>  	bool ret = false;
>  
> -	if (!adev || !acpi_has_method(adev->handle, acpi_method))
> +	handle = ACPI_HANDLE(dev);
> +	if (!handle)
>  		return false;
>  
> -	status = acpi_evaluate_object(adev->handle, acpi_method, NULL, &buffer);
> +	if (!acpi_has_method(handle, acpi_method))
> +		return false;
> +
> +	status = acpi_evaluate_object(handle, acpi_method, NULL, &buffer);
>  	if (ACPI_FAILURE(status)) {
>  		dev_err(dev, "Failed to get ACPI mount matrix: %d\n", status);
>  		return false;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ