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: <20221223152444.63310805@jic23-huawei>
Date:   Fri, 23 Dec 2022 15:24:44 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v1 2/2] iio: adc: ti-adc128s052: Drop anti-pattern of
 ACPI_PTR() use

On Wed, 14 Dec 2022 13:49:44 +0200
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:

> ACPI_PTR() is more harmful than helpful. For example, in this case
> if CONFIG_ACPI=n, the ID table left unused and code is obfuscated
> by ifdeffery.
> 
> Drop anti-pattern of ACPI_PTR() use.
Longer term I wonder if we should just make ACPI_PTR() work the same
way as pm_ptr() now does so that the visibility is maintained and
we don't need the ifdef magic.

I'm sure there is someone out there somewhere who actually cares about
the minor costs of all these tables for their non ACPI platform and
doing something like that might make everyone happier.

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Applied.
> ---
>  drivers/iio/adc/ti-adc128s052.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
> index 9dfc625100b6..fc09ee6bb174 100644
> --- a/drivers/iio/adc/ti-adc128s052.c
> +++ b/drivers/iio/adc/ti-adc128s052.c
> @@ -9,7 +9,6 @@
>   * https://www.ti.com/lit/ds/symlink/adc124s021.pdf
>   */
>  
> -#include <linux/acpi.h>
>  #include <linux/err.h>
>  #include <linux/spi/spi.h>
>  #include <linux/module.h>
> @@ -201,19 +200,17 @@ static const struct spi_device_id adc128_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, adc128_id);
>  
> -#ifdef CONFIG_ACPI
>  static const struct acpi_device_id adc128_acpi_match[] = {
>  	{ "AANT1280", (kernel_ulong_t)&adc128_config[2] },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, adc128_acpi_match);
> -#endif
>  
>  static struct spi_driver adc128_driver = {
>  	.driver = {
>  		.name = "adc128s052",
>  		.of_match_table = adc128_of_match,
> -		.acpi_match_table = ACPI_PTR(adc128_acpi_match),
> +		.acpi_match_table = adc128_acpi_match,
>  	},
>  	.probe = adc128_probe,
>  	.id_table = adc128_id,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ