diff mbox series

[01/24] iio: accel: da280: Stop using ACPI_PTR()

Message ID 20231231183514.566609-2-jic23@kernel.org (mailing list archive)
State Accepted
Headers show
Series IIO: Clean up ACPI_PTR() usage. | expand

Commit Message

Jonathan Cameron Dec. 31, 2023, 6:34 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

In general using ACPI_PTR() leads to more fragile code for a very
minor saving in storage in the case of !CONFIG_ACPI so in IIO we
prefer not to use it if the only ACPI specific code is the acpi_device_id
table.

In this case will also suppress a unused variable warning.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202302142222.vVU0E4eu-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Hans de Goede <hdegoede@redhat.com>
---
 drivers/iio/accel/da280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede Jan. 1, 2024, 1:24 p.m. UTC | #1
Hi,

On 12/31/23 19:34, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> In general using ACPI_PTR() leads to more fragile code for a very
> minor saving in storage in the case of !CONFIG_ACPI so in IIO we
> prefer not to use it if the only ACPI specific code is the acpi_device_id
> table.
> 
> In this case will also suppress a unused variable warning.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202302142222.vVU0E4eu-lkp@intel.com/
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/iio/accel/da280.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/da280.c b/drivers/iio/accel/da280.c
> index 572bfe9694b0..d792d2d20344 100644
> --- a/drivers/iio/accel/da280.c
> +++ b/drivers/iio/accel/da280.c
> @@ -186,7 +186,7 @@ MODULE_DEVICE_TABLE(i2c, da280_i2c_id);
>  static struct i2c_driver da280_driver = {
>  	.driver = {
>  		.name = "da280",
> -		.acpi_match_table = ACPI_PTR(da280_acpi_match),
> +		.acpi_match_table = da280_acpi_match,
>  		.pm = pm_sleep_ptr(&da280_pm_ops),
>  	},
>  	.probe		= da280_probe,
diff mbox series

Patch

diff --git a/drivers/iio/accel/da280.c b/drivers/iio/accel/da280.c
index 572bfe9694b0..d792d2d20344 100644
--- a/drivers/iio/accel/da280.c
+++ b/drivers/iio/accel/da280.c
@@ -186,7 +186,7 @@  MODULE_DEVICE_TABLE(i2c, da280_i2c_id);
 static struct i2c_driver da280_driver = {
 	.driver = {
 		.name = "da280",
-		.acpi_match_table = ACPI_PTR(da280_acpi_match),
+		.acpi_match_table = da280_acpi_match,
 		.pm = pm_sleep_ptr(&da280_pm_ops),
 	},
 	.probe		= da280_probe,