IIO: Clean up ACPI_PTR() usage.
Subsystems (2)
Jonathan Cameron
maintainercover IIO: Clean up ACPI_PTR() usage.
From: Jonathan Cameron <[email protected]>
Many of these patches touch ancient drivers so the authors have long moved on to other things. As such I'd appreciate it if anyone has time to take a look!
The initial part of this series deals with cases where unused variable warnings are generated with !CONFIG_ACPI but they most date back long enough to predate this being reported by lkp in general and the lkp folk have gotten push back not to push out such reports due to the high level of noise. I think some of these were reported to me directly on my Huawei.com account but aren't on lore.kernel.org. If I can easily track down appropriate closes tags I will add them when applying.
The last few patches are for drivers that did have the right protections but where the usage was so trivial I'm not convinced they took the best approach. In the interests of not leaving cases of what I consider an undesirable pattern around for people to copy I have dropped the ACPI_PTR() usage and config guards from those as well.
There are 3 remaining cases of ACPI_PTR() in IIO. In each of those there is a significant chunk of ACPI specific handling so the relevant guards are there anyway and the complexity is more easily justified. I have not intent to touch those at this time.
Jonathan Cameron (24):
iio: accel: da280: Stop using ACPI_PTR()
iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef
CONFIG_ACPI
iio: accel: mma9551: Drop ACPI_PTR() usage
iio: accel: mma9553: Drop ACPI_PTR() usage
iio: accel: mxc4005: Drop ACPI_PTR() usage
iio: accel: mxc6255: Drop ACPI_PTR() usage
iio: accel: stk8ba50: Drop ACPI_PTR() usage
iio: accel: bmc150: Drop ACPI_PTR()
iio: gyro: bmg160: Drop ACPI_PTR() usage
iio: humidity: hts221: Drop ACPI_PTR() usage
iio: imu: fxos8700: Drop ACPI_PTR() usage
iio: imu: kmx61: Drop ACPI_PTR() usage
iio: light: jsa1212: Drop ACPI_PTR() usage
iio: light: ltr501: Drop ACPI_PTR() usage
iio: light: rpr0521: Drop ACPI_PTR() usage
iio: light: stk3310: Drop ACPI_PTR() usage
iio: light: us5182d: Drop ACPI_PTR() usage
iio: magnetometer: bmc150: Drop ACPI_PTR() usage
iio: magnetometer: mmc35240: Drop ACPI_PTR() usage
iio: potentiometer: max5487: Drop ACPI_PTR() usage
iio: st_sensors: drop ACPI_PTR() and CONFIG_ACPI guards
iio: pressure: hp206c: drop ACPI_PTR() and CONFIG_ACPI guards
iio: light: max44000: drop ACPI_PTR() and CONFIG_ACPI guards
iio: adc: ti-adc109s102: drop ACPI_PTR() and CONFIG_ACPI guards
drivers/iio/accel/bmc150-accel-i2c.c | 2 +- drivers/iio/accel/bmc150-accel-spi.c | 3 +- drivers/iio/accel/da280.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 33 +++++++++++----------- drivers/iio/accel/mma9551.c | 4 +-- drivers/iio/accel/mma9553.c | 4 +-- drivers/iio/accel/mxc4005.c | 4 +-- drivers/iio/accel/mxc6255.c | 4 +-- drivers/iio/accel/st_accel_i2c.c | 5 +--- drivers/iio/accel/stk8ba50.c | 4 +-- drivers/iio/adc/ti-adc108s102.c | 4 +-- drivers/iio/gyro/bmg160_i2c.c | 4 +-- drivers/iio/humidity/hts221_i2c.c | 4 +-- drivers/iio/imu/fxos8700_i2c.c | 3 +- drivers/iio/imu/fxos8700_spi.c | 3 +- drivers/iio/imu/kmx61.c | 2 +- drivers/iio/light/jsa1212.c | 4 +-- drivers/iio/light/ltr501.c | 3 +- drivers/iio/light/max44000.c | 6 ++-- drivers/iio/light/rpr0521.c | 4 +-- drivers/iio/light/stk3310.c | 4 +-- drivers/iio/light/us5182d.c | 4 +-- drivers/iio/magnetometer/bmc150_magn_i2c.c | 3 +- drivers/iio/magnetometer/bmc150_magn_spi.c | 3 +- drivers/iio/magnetometer/mmc35240.c | 4 +-- drivers/iio/potentiometer/max5487.c | 4 +-- drivers/iio/pressure/hp206c.c | 6 ++-- drivers/iio/pressure/st_pressure_i2c.c | 5 +--- 28 files changed, 60 insertions(+), 75 deletions(-)
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 1/24 iio: accel: da280: Stop using ACPI_PTR()
From: Jonathan Cameron <[email protected]>
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.
--- drivers/iio/accel/da280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/da280.c +1 -1
@@ -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,
Signature · 1 line
2.43.0
Re: [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR()
Hi,
Quoted 7 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
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 theacpi_device_idtable.
Quoted 6 lines
In this case will also suppress a unused variable warning.
Reported-by kernel test robot <[email protected]>Signed-off-by Jonathan Cameron <[email protected]>Cc Hans de Goede <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 17 lines
--- drivers/iio/accel/da280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/accel/da280.c +1
-1@@ -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,
Jonathan Cameron
maintainerPATCH 2/24 iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
This avoids a build warning due to the use of ACPI_PTR(). Given the driver already has APCI specific code under CONFIG_ACPI move the table rather than removing the ACPI_PTR() call as we already have the complexity of CONFIG_ACPI.
--- drivers/iio/accel/kxcjk-1013.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)
drivers/iio/accel/kxcjk-1013.c +17 -16
@@ -422,6 +422,23 @@ static int kiox010a_dsm(struct device *dev, int fn_index)ACPI_FREE (obj);return 0 ; } + +static const struct acpi_device_id kx_acpi_match[] = { + {"KXCJ1013" ,KXCJK1013 }, + {"KXCJ1008" ,KXCJ91008 }, + {"KXCJ9000" ,KXCJ91008 }, + {"KIOX0008" ,KXCJ91008 }, + {"KIOX0009" ,KXTJ21009 }, + {"KIOX000A" ,KXCJ91008 }, + {"KIOX010A" ,KXCJ91008 },/* KXCJ91008 in the display of a yoga 2-in-1 */ + {"KIOX020A" ,KXCJ91008 },/* KXCJ91008 in the base of a yoga 2-in-1 */ + {"KXTJ1009" ,KXTJ21009 }, + {"KXJ2109" ,KXTJ21009 }, + {"SMO8500" ,KXCJ91008 }, + { }, +}; +MODULE_DEVICE_TABLE (acpi, kx_acpi_match); +#endif static int kxcjk1013_set_mode(struct kxcjk1013_data *data,
@@ -1687,22 +1704,6 @@ static const struct dev_pm_ops kxcjk1013_pm_ops = { kxcjk1013_runtime_resume, NULL) }; -static const struct acpi_device_id kx_acpi_match[] = { - {"KXCJ1013" ,KXCJK1013 }, - {"KXCJ1008" ,KXCJ91008 }, - {"KXCJ9000" ,KXCJ91008 }, - {"KIOX0008" ,KXCJ91008 }, - {"KIOX0009" ,KXTJ21009 }, - {"KIOX000A" ,KXCJ91008 }, - {"KIOX010A" ,KXCJ91008 },/* KXCJ91008 in the display of a yoga 2-in-1 */ - {"KIOX020A" ,KXCJ91008 },/* KXCJ91008 in the base of a yoga 2-in-1 */ - {"KXTJ1009" ,KXTJ21009 }, - {"KXJ2109" ,KXTJ21009 }, - {"SMO8500" ,KXCJ91008 }, - { }, -}; -MODULE_DEVICE_TABLE (acpi, kx_acpi_match); -static const struct i2c_device_id kxcjk1013_id[] = { {"kxcjk1013" ,KXCJK1013 }, {"kxcj91008" ,KXCJ91008 },
Signature · 1 line
2.43.0
Re: [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI
Hi,
Quoted 9 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
This avoids a build warning due to the use of
ACPI_PTR(). Given the driver already has APCI specific code underCONFIG_ACPImove the table rather than removing theACPI_PTR()call as we already have the complexity ofCONFIG_ACPI.Signed-off-by Jonathan Cameron <[email protected]>Cc Hans de Goede <[email protected]>
Thanks, patch looks good to me:
Regards,
Hans
Quoted 55 lines
--- drivers/iio/accel/kxcjk-1013.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)drivers/iio/accel/kxcjk-1013.c +17
-16@@ -422,6 +422,23 @@ static int kiox010a_dsm(struct device *dev, int fn_index)ACPI_FREE (obj);return 0 ; } + +static const struct acpi_device_id kx_acpi_match[] = { + {"KXCJ1013" ,KXCJK1013 }, + {"KXCJ1008" ,KXCJ91008 }, + {"KXCJ9000" ,KXCJ91008 }, + {"KIOX0008" ,KXCJ91008 }, + {"KIOX0009" ,KXTJ21009 }, + {"KIOX000A" ,KXCJ91008 }, + {"KIOX010A" ,KXCJ91008 },/* KXCJ91008 in the display of a yoga 2-in-1 */ + {"KIOX020A" ,KXCJ91008 },/* KXCJ91008 in the base of a yoga 2-in-1 */ + {"KXTJ1009" ,KXTJ21009 }, + {"KXJ2109" ,KXTJ21009 }, + {"SMO8500" ,KXCJ91008 }, + { }, +}; +MODULE_DEVICE_TABLE (acpi, kx_acpi_match); +#endif static int kxcjk1013_set_mode(struct kxcjk1013_data *data,@@ -1687,22 +1704,6 @@ static const struct dev_pm_ops kxcjk1013_pm_ops = { kxcjk1013_runtime_resume, NULL) }; -static const struct acpi_device_id kx_acpi_match[] = { - {"KXCJ1013" ,KXCJK1013 }, - {"KXCJ1008" ,KXCJ91008 }, - {"KXCJ9000" ,KXCJ91008 }, - {"KIOX0008" ,KXCJ91008 }, - {"KIOX0009" ,KXTJ21009 }, - {"KIOX000A" ,KXCJ91008 }, - {"KIOX010A" ,KXCJ91008 },/* KXCJ91008 in the display of a yoga 2-in-1 */ - {"KIOX020A" ,KXCJ91008 },/* KXCJ91008 in the base of a yoga 2-in-1 */ - {"KXTJ1009" ,KXTJ21009 }, - {"KXJ2109" ,KXTJ21009 }, - {"SMO8500" ,KXCJ91008 }, - { }, -}; -MODULE_DEVICE_TABLE (acpi, kx_acpi_match); -static const struct i2c_device_id kxcjk1013_id[] = { {"kxcjk1013" ,KXCJK1013 }, {"kxcj91008" ,KXCJ91008 },
Re: [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI
In reply to Jonathan CameronQuoted 7 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
This avoids a build warning due to the use of
ACPI_PTR(). Given the driver already has APCI specific code underCONFIG_ACPImove the table rather than removing theACPI_PTR()call as we already have the complexity ofCONFIG_ACPI.
...
Quoted 4 lines
drivers/iio/accel/kxcjk-1013.c +4
-0+static const struct acpi_device_id kx_acpi_match[] = { + {"KXCJ1013" ,KXCJK1013 }, + {"KXCJ1008" ,KXCJ91008 }, + {"KXCJ9000" ,KXCJ91008 },
drivers/iio/accel/kxcjk-1013.c static int kiox010a_dsm(struct device *dev, int fn_index)
Quoted 10 lines
drivers/iio/accel/kxcjk-1013.c +9
-0+ {"KIOX0008", KXCJ91008}, + {"KIOX0009", KXTJ21009}, + {"KIOX000A", KXCJ91008}, + {"KIOX010A", KXCJ91008}, /* KXCJ91008 in the display of a yoga 2-in-1 */ + {"KIOX020A", KXCJ91008}, /* KXCJ91008 in the base of a yoga 2-in-1 */ + {"KXTJ1009", KXTJ21009}, + {"KXJ2109", KXTJ21009}, + {"SMO8500", KXCJ91008}, + { },
Can you drop the comma, while at it?
Quoted 1 line
+};
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerPATCH 3/24 iio: accel: mma9551: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Whilst here tidy up a trivial bit of unusual indentation.
--- drivers/iio/accel/mma9551.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/mma9551.c +2 -2
@@ -604,9 +604,9 @@ MODULE_DEVICE_TABLE(i2c, mma9551_id);static struct i2c_driver mma9551_driver = { .driver = { .name =MMA9551_DRV_NAME , - .acpi_match_table =ACPI_PTR (mma9551_acpi_match), + .acpi_match_table = mma9551_acpi_match, .pm =pm_ptr (&mma9551_pm_ops), - }, + }, .probe = mma9551_probe, .remove = mma9551_remove, .id_table = mma9551_id,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 4/24 iio: accel: mma9553: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Whilst here tidy up a trivial bit of unusual indentation.
--- drivers/iio/accel/mma9553.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/mma9553.c +2 -2
@@ -1243,9 +1243,9 @@ MODULE_DEVICE_TABLE(i2c, mma9553_id);static struct i2c_driver mma9553_driver = { .driver = { .name =MMA9553_DRV_NAME , - .acpi_match_table =ACPI_PTR (mma9553_acpi_match), + .acpi_match_table = mma9553_acpi_match, .pm =pm_ptr (&mma9553_pm_ops), - }, + }, .probe = mma9553_probe, .remove = mma9553_remove, .id_table = mma9553_id,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 5/24 iio: accel: mxc4005: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include to mod_devicetable.h as that contains the only acpi specific definitions needed in this driver.
--- drivers/iio/accel/mxc4005.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/mxc4005.c +2 -2
@@ -8,7 +8,7 @@#include <linux/module.h> #include <linux/i2c.h> #include <linux/iio/iio.h> -#include <linux/acpi.h> +#include <linux/mod_devicetable.h> #include <linux/regmap.h> #include <linux/iio/sysfs.h> #include <linux/iio/trigger.h>
@@ -493,7 +493,7 @@ MODULE_DEVICE_TABLE(i2c, mxc4005_id);static struct i2c_driver mxc4005_driver = { .driver = { .name =MXC4005_DRV_NAME , - .acpi_match_table =ACPI_PTR (mxc4005_acpi_match), + .acpi_match_table = mxc4005_acpi_match, .of_match_table = mxc4005_of_match, }, .probe = mxc4005_probe,
Signature · 1 line
2.43.0
Re: [PATCH 05/24] iio: accel: mxc4005: Drop ACPI_PTR() usage
Quoted 9 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include to
mod_devicetable.has that contains the only acpi specific definitions needed in this driver.
ACPI
(and in other commit messages that repeat this text)
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerPATCH 6/24 iio: accel: mxc6255: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include to mod_devicetable.h as that contains the only acpi specific definitions needed in this driver.
---
I can only find this one reported in a much larger build report (where it was noise) so no obvious closes tag to use.
--- drivers/iio/accel/mxc6255.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/mxc6255.c +2 -2
@@ -12,7 +12,7 @@#include <linux/init.h> #include <linux/iio/iio.h> #include <linux/delay.h> -#include <linux/acpi.h> +#include <linux/mod_devicetable.h> #include <linux/regmap.h> #include <linux/iio/sysfs.h>
@@ -181,7 +181,7 @@ MODULE_DEVICE_TABLE(i2c, mxc6255_id);static struct i2c_driver mxc6255_driver = { .driver = { .name =MXC6255_DRV_NAME , - .acpi_match_table =ACPI_PTR (mxc6255_acpi_match), + .acpi_match_table = mxc6255_acpi_match, }, .probe = mxc6255_probe, .id_table = mxc6255_id,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 7/24 iio: accel: stk8ba50: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include to mod_devicetable.h as that contains the only acpi specific definitions needed in this driver.
--- drivers/iio/accel/stk8ba50.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/stk8ba50.c +2 -2
@@ -7,11 +7,11 @@* STK8BA50 7-bit I2C address: 0x18. */ -#include <linux/acpi.h> #include <linux/i2c.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
@@ -541,7 +541,7 @@ static struct i2c_driver stk8ba50_driver = { .driver = { .name = "stk8ba50", .pm = pm_sleep_ptr(&stk8ba50_pm_ops), - .acpi_match_table = ACPI_PTR(stk8ba50_acpi_id), + .acpi_match_table = stk8ba50_acpi_id, }, .probe = stk8ba50_probe, .remove = stk8ba50_remove,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 8/24 iio: accel: bmc150: Drop ACPI_PTR()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
In general the complexity of avoiding maybe unused variable warnings is not worth dealing with for the small amount of data saved. In thie case, the i2c driver does include some other code under a CONFIG_ACPI guard but remove the ACPI_PTR() usage anyway to bring keep it inline with the spi driver.
Drop include of linux/acpi.h in the spi driver that doesn't need it as struct acpi_device_id is defined in mod_devicetable.h which is already included.
--- drivers/iio/accel/bmc150-accel-i2c.c | 2 +- drivers/iio/accel/bmc150-accel-spi.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/iio/accel/bmc150-accel-i2c.c +1 -1
@@ -266,7 +266,7 @@ static struct i2c_driver bmc150_accel_driver = { .driver = { .name = "bmc150_accel_i2c", .of_match_table = bmc150_accel_of_match, - .acpi_match_table = ACPI_PTR(bmc150_accel_acpi_match), + .acpi_match_table = bmc150_accel_acpi_match, .pm = &bmc150_accel_pm_ops, }, .probe = bmc150_accel_probe,
drivers/iio/accel/bmc150-accel-spi.c +1 -2
@@ -7,7 +7,6 @@#include <linux/device.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/acpi.h> #include <linux/regmap.h> #include <linux/spi/spi.h>
@@ -70,7 +69,7 @@ MODULE_DEVICE_TABLE(spi, bmc150_accel_id);static struct spi_driver bmc150_accel_driver = { .driver = { .name ="bmc150_accel_spi" , - .acpi_match_table =ACPI_PTR (bmc150_accel_acpi_match), + .acpi_match_table = bmc150_accel_acpi_match, .pm = &bmc150_accel_pm_ops, }, .probe = bmc150_accel_probe,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 9/24 iio: gyro: bmg160: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include to mod_devicetable.h as that contains the only acpi specific definitions needed in this driver.
--- drivers/iio/gyro/bmg160_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/gyro/bmg160_i2c.c +2 -2
@@ -3,7 +3,7 @@#include <linux/regmap.h> #include <linux/iio/iio.h> #include <linux/module.h> -#include <linux/acpi.h> +#include <linux/mod_devicetable.h> #include "bmg160.h"
@@ -66,7 +66,7 @@ MODULE_DEVICE_TABLE(of, bmg160_of_match);static struct i2c_driver bmg160_i2c_driver = { .driver = { .name ="bmg160_i2c" , - .acpi_match_table =ACPI_PTR (bmg160_acpi_match), + .acpi_match_table = bmg160_acpi_match, .of_match_table = bmg160_of_match, .pm = &bmg160_pm_ops, },
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 10/24 iio: humidity: hts221: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include to mod_devicetable.h as that contains the only ACPI specific definitions needed in this driver.
--- drivers/iio/humidity/hts221_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/humidity/hts221_i2c.c +2 -2
@@ -9,7 +9,7 @@#include <linux/kernel.h> #include <linux/module.h> -#include <linux/acpi.h> +#include <linux/mod_devicetable.h> #include <linux/i2c.h> #include <linux/slab.h> #include <linux/regmap.h>
@@ -63,7 +63,7 @@ static struct i2c_driver hts221_driver = { .name = "hts221_i2c", .pm = pm_sleep_ptr(&hts221_pm_ops), .of_match_table = hts221_i2c_of_match, - .acpi_match_table = ACPI_PTR(hts221_acpi_match), + .acpi_match_table = hts221_acpi_match, }, .probe = hts221_i2c_probe, .id_table = hts221_i2c_id_table,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 11/24 iio: imu: fxos8700: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Drop unused acpi.h include.
--- drivers/iio/imu/fxos8700_i2c.c | 3 +-- drivers/iio/imu/fxos8700_spi.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/iio/imu/fxos8700_i2c.c +1 -2
@@ -10,7 +10,6 @@* 1 | 0 | 0x1C * 1 | 1 | 0x1F */ -#include <linux/acpi.h> #include <linux/i2c.h> #include <linux/module.h> #include <linux/mod_devicetable.h>
@@ -57,7 +56,7 @@ MODULE_DEVICE_TABLE(of, fxos8700_of_match);static struct i2c_driver fxos8700_i2c_driver = { .driver = { .name ="fxos8700_i2c" , - .acpi_match_table =ACPI_PTR (fxos8700_acpi_match), + .acpi_match_table = fxos8700_acpi_match, .of_match_table = fxos8700_of_match, }, .probe = fxos8700_i2c_probe,
drivers/iio/imu/fxos8700_spi.c +1 -2
@@ -2,7 +2,6 @@/* * FXOS8700 - NXP IMU, SPI bits */ -#include <linux/acpi.h> #include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/regmap.h>
@@ -46,7 +45,7 @@ static struct spi_driver fxos8700_spi_driver = { .probe = fxos8700_spi_probe, .id_table = fxos8700_spi_id, .driver = { - .acpi_match_table = ACPI_PTR(fxos8700_acpi_match), + .acpi_match_table = fxos8700_acpi_match, .of_match_table = fxos8700_of_match, .name = "fxos8700_spi", },
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 12/24 iio: imu: kmx61: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
--- drivers/iio/imu/kmx61.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/kmx61.c +1 -1
@@ -1514,7 +1514,7 @@ MODULE_DEVICE_TABLE(i2c, kmx61_id);static struct i2c_driver kmx61_driver = { .driver = { .name =KMX61_DRV_NAME , - .acpi_match_table =ACPI_PTR (kmx61_acpi_match), + .acpi_match_table = kmx61_acpi_match, .pm =pm_ptr (&kmx61_pm_ops), }, .probe = kmx61_probe,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 13/24 iio: light: jsa1212: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include from acpi.h to mod_devicetable.h which includes the definition of struct acpi_device_id.
--- drivers/iio/light/jsa1212.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/light/jsa1212.c +2 -2
@@ -12,10 +12,10 @@#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/delay.h> #include <linux/i2c.h> #include <linux/mutex.h> -#include <linux/acpi.h> #include <linux/regmap.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
@@ -438,7 +438,7 @@ static struct i2c_driver jsa1212_driver = { .driver = { .name = JSA1212_DRIVER_NAME, .pm = pm_sleep_ptr(&jsa1212_pm_ops), - .acpi_match_table = ACPI_PTR(jsa1212_acpi_match), + .acpi_match_table = jsa1212_acpi_match, }, .probe = jsa1212_probe, .remove = jsa1212_remove,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 14/24 iio: light: ltr501: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Include linux/mod_devicetable.h which includes the definition of struct acpi_device_id (hence somewhat related to the main change)
--- drivers/iio/light/ltr501.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/light/ltr501.c +2 -1
@@ -10,6 +10,7 @@*/ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/i2c.h> #include <linux/err.h> #include <linux/delay.h>
@@ -1639,7 +1640,7 @@ static struct i2c_driver ltr501_driver = { .name = LTR501_DRV_NAME, .of_match_table = ltr501_of_match, .pm = pm_sleep_ptr(<r501_pm_ops), - .acpi_match_table = ACPI_PTR(ltr_acpi_match), + .acpi_match_table = ltr_acpi_match, }, .probe = ltr501_probe, .remove = ltr501_remove,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 15/24 iio: light: rpr0521: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include from acpi.h to mod_devicetable.h which includes the definition of struct acpi_device_id.
--- drivers/iio/light/rpr0521.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/light/rpr0521.c +2 -2
@@ -10,11 +10,11 @@*/ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/regmap.h> #include <linux/delay.h> -#include <linux/acpi.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h>
@@ -1119,7 +1119,7 @@ static struct i2c_driver rpr0521_driver = { .driver = { .name = RPR0521_DRV_NAME, .pm = pm_ptr(&rpr0521_pm_ops), - .acpi_match_table = ACPI_PTR(rpr0521_acpi_match), + .acpi_match_table = rpr0521_acpi_match, }, .probe = rpr0521_probe, .remove = rpr0521_remove,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 16/24 iio: light: stk3310: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include from acpi.h to mod_devicetable.h which includes the definition of struct acpi_device_id.
---
The report I can immediately find is in a much larger set of unrelated errors hence no closes tag.
--- drivers/iio/light/stk3310.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/light/stk3310.c +2 -2
@@ -7,11 +7,11 @@* IIO driver for STK3310/STK3311. 7-bit I2C address: 0x48. */ -#include <linux/acpi.h> #include <linux/i2c.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/regmap.h> #include <linux/iio/events.h> #include <linux/iio/iio.h>
@@ -712,7 +712,7 @@ static struct i2c_driver stk3310_driver = { .name = "stk3310", .of_match_table = stk3310_of_match, .pm = pm_sleep_ptr(&stk3310_pm_ops), - .acpi_match_table = ACPI_PTR(stk3310_acpi_id), + .acpi_match_table = stk3310_acpi_id, }, .probe = stk3310_probe, .remove = stk3310_remove,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 17/24 iio: light: us5182d: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include from acpi.h to mod_devicetable.h which includes the definition of struct acpi_device_id.
--- drivers/iio/light/us5182d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/light/us5182d.c +2 -2
@@ -9,7 +9,7 @@#include <linux/kernel.h> #include <linux/module.h> -#include <linux/acpi.h> +#include <linux/mod_devicetable.h> #include <linux/delay.h> #include <linux/i2c.h> #include <linux/iio/events.h>
@@ -972,7 +972,7 @@ static struct i2c_driver us5182d_driver = { .name = US5182D_DRV_NAME, .pm = pm_ptr(&us5182d_pm_ops), .of_match_table = us5182d_of_match, - .acpi_match_table = ACPI_PTR(us5182d_acpi_match), + .acpi_match_table = us5182d_acpi_match, }, .probe = us5182d_probe, .remove = us5182d_remove,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 18/24 iio: magnetometer: bmc150: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Drop unused linux/acpi.h includes.
--- drivers/iio/magnetometer/bmc150_magn_i2c.c | 3 +-- drivers/iio/magnetometer/bmc150_magn_spi.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/iio/magnetometer/bmc150_magn_i2c.c +1 -2
@@ -11,7 +11,6 @@#include <linux/mod_devicetable.h> #include <linux/i2c.h> #include <linux/module.h> -#include <linux/acpi.h> #include <linux/regmap.h> #include "bmc150_magn.h"
@@ -68,7 +67,7 @@ static struct i2c_driver bmc150_magn_driver = { .driver = { .name = "bmc150_magn_i2c", .of_match_table = bmc150_magn_of_match, - .acpi_match_table = ACPI_PTR(bmc150_magn_acpi_match), + .acpi_match_table = bmc150_magn_acpi_match, .pm = &bmc150_magn_pm_ops, }, .probe = bmc150_magn_i2c_probe,
drivers/iio/magnetometer/bmc150_magn_spi.c +1 -2
@@ -10,7 +10,6 @@#include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/spi/spi.h> -#include <linux/acpi.h> #include <linux/regmap.h> #include "bmc150_magn.h"
@@ -55,7 +54,7 @@ static struct spi_driver bmc150_magn_spi_driver = { .remove = bmc150_magn_spi_remove, .id_table = bmc150_magn_spi_id, .driver = { - .acpi_match_table = ACPI_PTR(bmc150_magn_acpi_match), + .acpi_match_table = bmc150_magn_acpi_match, .name = "bmc150_magn_spi", }, };
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 19/24 iio: magnetometer: mmc35240: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include from acpi.h to mod_devicetable.h which includes the definition of struct acpi_device_id.
--- drivers/iio/magnetometer/mmc35240.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/mmc35240.c +2 -2
@@ -10,11 +10,11 @@*/ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/delay.h> #include <linux/regmap.h> -#include <linux/acpi.h> #include <linux/pm.h> #include <linux/iio/iio.h>
@@ -573,7 +573,7 @@ static struct i2c_driver mmc35240_driver = { .name = MMC35240_DRV_NAME, .of_match_table = mmc35240_of_match, .pm = pm_sleep_ptr(&mmc35240_pm_ops), - .acpi_match_table = ACPI_PTR(mmc35240_acpi_match), + .acpi_match_table = mmc35240_acpi_match, }, .probe = mmc35240_probe, .id_table = mmc35240_id,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 20/24 iio: potentiometer: max5487: Drop ACPI_PTR() usage
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Avoiding unused variable warnings when using this macro adds complexity that in simple cases like this one is not justified for the small saving in data.
Switch include from acpi.h to mod_devicetable.h which includes the definition of struct acpi_device_id.
---
I can't find a specific listing for this one so no closes tag.
--- drivers/iio/potentiometer/max5487.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/potentiometer/max5487.c +2 -2
@@ -5,8 +5,8 @@* Copyright (C) 2016 Cristina-Gabriela Moraru <[email protected]> */ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/spi/spi.h> -#include <linux/acpi.h> #include <linux/iio/sysfs.h> #include <linux/iio/iio.h>
@@ -144,7 +144,7 @@ MODULE_DEVICE_TABLE(acpi, max5487_acpi_match);static struct spi_driver max5487_driver = { .driver = { .name ="max5487" , - .acpi_match_table =ACPI_PTR (max5487_acpi_match), + .acpi_match_table = max5487_acpi_match, }, .id_table = max5487_id, .probe = max5487_spi_probe,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 21/24 iio: st_sensors: drop ACPI_PTR() and CONFIG_ACPI guards
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong. Also drop now unneeded linux/acpi.h include.
--- drivers/iio/accel/st_accel_i2c.c | 5 +---- drivers/iio/pressure/st_pressure_i2c.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-)
drivers/iio/accel/st_accel_i2c.c +1 -4
@@ -10,7 +10,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h> -#include <linux/acpi.h> #include <linux/i2c.h> #include <linux/iio/iio.h>
@@ -127,14 +126,12 @@ static const struct of_device_id st_accel_of_match[] = { };MODULE_DEVICE_TABLE (of, st_accel_of_match); -#ifdef CONFIG_ACPI static const struct acpi_device_id st_accel_acpi_match[] = { {"SMO8840" , (kernel_ulong_t )LIS2DH12_ACCEL_DEV_NAME }, {"SMO8A90" , (kernel_ulong_t )LNG2DM_ACCEL_DEV_NAME }, { }, };MODULE_DEVICE_TABLE (acpi, st_accel_acpi_match); -#endif static const struct i2c_device_id st_accel_id_table[] = { {LSM303DLH_ACCEL_DEV_NAME },
@@ -204,7 +201,7 @@ static struct i2c_driver st_accel_driver = { .driver = { .name = "st-accel-i2c", .of_match_table = st_accel_of_match, - .acpi_match_table = ACPI_PTR(st_accel_acpi_match), + .acpi_match_table = st_accel_acpi_match, }, .probe = st_accel_i2c_probe, .id_table = st_accel_id_table,
drivers/iio/pressure/st_pressure_i2c.c +1 -4
@@ -7,7 +7,6 @@* Denis Ciocca <[email protected]> */ -#include <linux/acpi.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/mod_devicetable.h>
@@ -55,13 +54,11 @@ static const struct of_device_id st_press_of_match[] = { };MODULE_DEVICE_TABLE (of, st_press_of_match); -#ifdef CONFIG_ACPI static const struct acpi_device_id st_press_acpi_match[] = { {"SNO9210" ,LPS22HB }, { }, };MODULE_DEVICE_TABLE (acpi, st_press_acpi_match); -#endif static const struct i2c_device_id st_press_id_table[] = { {LPS001WP_PRESS_DEV_NAME ,LPS001WP },
@@ -114,7 +111,7 @@ static struct i2c_driver st_press_driver = { .driver = { .name = "st-press-i2c", .of_match_table = st_press_of_match, - .acpi_match_table = ACPI_PTR(st_press_acpi_match), + .acpi_match_table = st_press_acpi_match, }, .probe = st_press_i2c_probe, .id_table = st_press_id_table,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 22/24 iio: pressure: hp206c: drop ACPI_PTR() and CONFIG_ACPI guards
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong. Also drop now unneeded linux/acpi.h include and added linux/mod_devicetable.h for struct acpi_device_id definition.
--- drivers/iio/pressure/hp206c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/iio/pressure/hp206c.c +2 -4
@@ -11,12 +11,12 @@*/ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/i2c.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/delay.h> #include <linux/util_macros.h> -#include <linux/acpi.h> #include <asm/unaligned.h>
@@ -400,20 +400,18 @@ static const struct i2c_device_id hp206c_id[] = { };MODULE_DEVICE_TABLE (i2c, hp206c_id); -#ifdef CONFIG_ACPI static const struct acpi_device_id hp206c_acpi_match[] = { {"HOP206C" ,0 }, { }, };MODULE_DEVICE_TABLE (acpi, hp206c_acpi_match); -#endif static struct i2c_driver hp206c_driver = { .probe = hp206c_probe, .id_table = hp206c_id, .driver = { .name ="hp206c" , - .acpi_match_table =ACPI_PTR (hp206c_acpi_match), + .acpi_match_table = hp206c_acpi_match, }, };
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 23/24 iio: light: max44000: drop ACPI_PTR() and CONFIG_ACPI guards
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong. Also drop now unneeded linux/acpi.h include and added linux/mod_devicetable.h for struct acpi_device_id definition.
--- drivers/iio/light/max44000.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/iio/light/max44000.c +2 -4
@@ -10,6 +10,7 @@*/ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/regmap.h>
@@ -19,7 +20,6 @@#include <linux/iio/buffer.h> #include <linux/iio/trigger_consumer.h> #include <linux/iio/triggered_buffer.h> -#include <linux/acpi.h> #define MAX44000_DRV_NAME "max44000"
@@ -603,18 +603,16 @@ static const struct i2c_device_id max44000_id[] = { };MODULE_DEVICE_TABLE (i2c, max44000_id); -#ifdef CONFIG_ACPI static const struct acpi_device_id max44000_acpi_match[] = { {"MAX44000" ,0 }, { } };MODULE_DEVICE_TABLE (acpi, max44000_acpi_match); -#endif static struct i2c_driver max44000_driver = { .driver = { .name =MAX44000_DRV_NAME , - .acpi_match_table =ACPI_PTR (max44000_acpi_match), + .acpi_match_table = max44000_acpi_match, }, .probe = max44000_probe, .id_table = max44000_id,
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerPATCH 24/24 iio: adc: ti-adc109s102: drop ACPI_PTR() and CONFIG_ACPI guards
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong.
--- drivers/iio/adc/ti-adc108s102.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/ti-adc108s102.c +1 -3
@@ -293,13 +293,11 @@ static const struct of_device_id adc108s102_of_match[] = { };MODULE_DEVICE_TABLE (of, adc108s102_of_match); -#ifdef CONFIG_ACPI static const struct acpi_device_id adc108s102_acpi_ids[] = { {"INT3495" ,0 }, { } };MODULE_DEVICE_TABLE (acpi, adc108s102_acpi_ids); -#endif static const struct spi_device_id adc108s102_id[] = { {"adc108s102" ,0 },
@@ -311,7 +309,7 @@ static struct spi_driver adc108s102_driver = { .driver = { .name = "adc108s102", .of_match_table = adc108s102_of_match, - .acpi_match_table = ACPI_PTR(adc108s102_acpi_ids), + .acpi_match_table = adc108s102_acpi_ids, }, .probe = adc108s102_probe, .id_table = adc108s102_id,
Signature · 1 line
2.43.0
Quoted 21 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Many of these patches touch ancient drivers so the authors have long moved on to other things. As such I'd appreciate it if anyone has time to take a look!
The initial part of this series deals with cases where unused variable warnings are generated with !CONFIG_ACPI but they most date back long enough to predate this being reported by lkp in general and the lkp folk have gotten push back not to push out such reports due to the high level of noise. I think some of these were reported to me directly on my Huawei.com account but aren't on lore.kernel.org. If I can easily track down appropriate closes tags I will add them when applying.
The last few patches are for drivers that did have the right protections but where the usage was so trivial I'm not convinced they took the best approach. In the interests of not leaving cases of what I consider an undesirable pattern around for people to copy I have dropped the
ACPI_PTR()usage and config guards from those as well.
Quoted 4 lines
There are 3 remaining cases of
ACPI_PTR()in IIO. In each of those there is a significant chunk of ACPI specific handling so the relevant guards are there anyway and the complexity is more easily justified. I have not intent to touch those at this time.
Long awaited series, thanks for doing it!
(with some individual nit-picks that you may fix whilst applying)
Side note: We now have: array_size.h, container_of.h, hex.h, kstrtox.h, sprintf.h.
You may start considering replacing "proxy" headers such as kernel.h in the code.
Quoted 60 lines
Jonathan Cameron (24):
iio: accel: da280: Stop usingACPI_PTR()
iio: accel: kxcjk-1013: Moveacpi_device_idtable under ifdef
CONFIG_ACPI
iio: accel: mma9551: DropACPI_PTR()usage
iio: accel: mma9553: DropACPI_PTR()usage
iio: accel: mxc4005: DropACPI_PTR()usage
iio: accel: mxc6255: DropACPI_PTR()usage
iio: accel: stk8ba50: DropACPI_PTR()usage
iio: accel: bmc150: DropACPI_PTR()
iio: gyro: bmg160: DropACPI_PTR()usage
iio: humidity: hts221: DropACPI_PTR()usage
iio: imu: fxos8700: DropACPI_PTR()usage
iio: imu: kmx61: DropACPI_PTR()usage
iio: light: jsa1212: DropACPI_PTR()usage
iio: light: ltr501: DropACPI_PTR()usage
iio: light: rpr0521: DropACPI_PTR()usage
iio: light: stk3310: DropACPI_PTR()usage
iio: light: us5182d: DropACPI_PTR()usage
iio: magnetometer: bmc150: DropACPI_PTR()usage
iio: magnetometer: mmc35240: DropACPI_PTR()usage
iio: potentiometer: max5487: DropACPI_PTR()usage
iio:st_sensors: dropACPI_PTR()andCONFIG_ACPIguards
iio: pressure: hp206c: dropACPI_PTR()andCONFIG_ACPIguards
iio: light: max44000: dropACPI_PTR()andCONFIG_ACPIguards
iio: adc: ti-adc109s102: dropACPI_PTR()andCONFIG_ACPIguardsdrivers/iio/accel/bmc150-accel-i2c.c | 2 +- drivers/iio/accel/bmc150-accel-spi.c | 3 +- drivers/iio/accel/da280.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 33 +++++++++++----------- drivers/iio/accel/mma9551.c | 4 +-- drivers/iio/accel/mma9553.c | 4 +-- drivers/iio/accel/mxc4005.c | 4 +-- drivers/iio/accel/mxc6255.c | 4 +-- drivers/iio/accel/st_accel_i2c.c | 5 +--- drivers/iio/accel/stk8ba50.c | 4 +-- drivers/iio/adc/ti-adc108s102.c | 4 +-- drivers/iio/gyro/bmg160_i2c.c | 4 +-- drivers/iio/humidity/hts221_i2c.c | 4 +-- drivers/iio/imu/fxos8700_i2c.c | 3 +- drivers/iio/imu/fxos8700_spi.c | 3 +- drivers/iio/imu/kmx61.c | 2 +- drivers/iio/light/jsa1212.c | 4 +-- drivers/iio/light/ltr501.c | 3 +- drivers/iio/light/max44000.c | 6 ++-- drivers/iio/light/rpr0521.c | 4 +-- drivers/iio/light/stk3310.c | 4 +-- drivers/iio/light/us5182d.c | 4 +-- drivers/iio/magnetometer/bmc150_magn_i2c.c | 3 +- drivers/iio/magnetometer/bmc150_magn_spi.c | 3 +- drivers/iio/magnetometer/mmc35240.c | 4 +-- drivers/iio/potentiometer/max5487.c | 4 +-- drivers/iio/pressure/hp206c.c | 6 ++-- drivers/iio/pressure/st_pressure_i2c.c | 5 +--- 28 files changed, 60 insertions(+), 75 deletions(-)--
2.43.0
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 22 lines · On Tue, 2 Jan 2024 01:48:07 +0200 Andy Shevchenko <[email protected]>…
Quoted 21 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Many of these patches touch ancient drivers so the authors have long moved on to other things. As such I'd appreciate it if anyone has time to take a look!
The initial part of this series deals with cases where unused variable warnings are generated with !CONFIG_ACPI but they most date back long enough to predate this being reported by lkp in general and the lkp folk have gotten push back not to push out such reports due to the high level of noise. I think some of these were reported to me directly on my Huawei.com account but aren't on lore.kernel.org. If I can easily track down appropriate closes tags I will add them when applying.
The last few patches are for drivers that did have the right protections but where the usage was so trivial I'm not convinced they took the best approach. In the interests of not leaving cases of what I consider an undesirable pattern around for people to copy I have dropped the
ACPI_PTR()usage and config guards from those as well.
Quoted 8 lines
Quoted 4 lines
There are 3 remaining cases of
ACPI_PTR()in IIO. In each of those there is a significant chunk of ACPI specific handling so the relevant guards are there anyway and the complexity is more easily justified. I have not intent to touch those at this time.Long awaited series, thanks for doing it!
Reviewed-by Andy Shevchenko <[email protected]>(with some individual nit-picks that you may fix whilst applying)
Thanks. Mostly so I can forget about this series, I've made the tweaks and applied the lot to the togreg branch of iio.git which will get rebased on rc1 in a few weeks time. Happy to add more tags etc or indeed drop any problematic patches if I get any more feedback in the meantime!
Quoted 5 lines
Side note: We now have:
array_size.h,container_of.h,hex.h,kstrtox.h,sprintf.h.
You may start considering replacing "proxy" headers such askernel.hin the code.
Hmm. That's more of a nice to have than this set where it's about getting 0-day to stop pestering me :)
Worth doing at some point though, perhaps as part of more substantial driver clean ups.
Thanks,
Jonathan
Quoted 63 lines
Quoted 61 lines
Jonathan Cameron (24):
iio: accel: da280: Stop usingACPI_PTR()
iio: accel: kxcjk-1013: Moveacpi_device_idtable under ifdef
CONFIG_ACPI
iio: accel: mma9551: DropACPI_PTR()usage
iio: accel: mma9553: DropACPI_PTR()usage
iio: accel: mxc4005: DropACPI_PTR()usage
iio: accel: mxc6255: DropACPI_PTR()usage
iio: accel: stk8ba50: DropACPI_PTR()usage
iio: accel: bmc150: DropACPI_PTR()
iio: gyro: bmg160: DropACPI_PTR()usage
iio: humidity: hts221: DropACPI_PTR()usage
iio: imu: fxos8700: DropACPI_PTR()usage
iio: imu: kmx61: DropACPI_PTR()usage
iio: light: jsa1212: DropACPI_PTR()usage
iio: light: ltr501: DropACPI_PTR()usage
iio: light: rpr0521: DropACPI_PTR()usage
iio: light: stk3310: DropACPI_PTR()usage
iio: light: us5182d: DropACPI_PTR()usage
iio: magnetometer: bmc150: DropACPI_PTR()usage
iio: magnetometer: mmc35240: DropACPI_PTR()usage
iio: potentiometer: max5487: DropACPI_PTR()usage
iio:st_sensors: dropACPI_PTR()andCONFIG_ACPIguards
iio: pressure: hp206c: dropACPI_PTR()andCONFIG_ACPIguards
iio: light: max44000: dropACPI_PTR()andCONFIG_ACPIguards
iio: adc: ti-adc109s102: dropACPI_PTR()andCONFIG_ACPIguardsdrivers/iio/accel/bmc150-accel-i2c.c | 2 +- drivers/iio/accel/bmc150-accel-spi.c | 3 +- drivers/iio/accel/da280.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 33 +++++++++++----------- drivers/iio/accel/mma9551.c | 4 +-- drivers/iio/accel/mma9553.c | 4 +-- drivers/iio/accel/mxc4005.c | 4 +-- drivers/iio/accel/mxc6255.c | 4 +-- drivers/iio/accel/st_accel_i2c.c | 5 +--- drivers/iio/accel/stk8ba50.c | 4 +-- drivers/iio/adc/ti-adc108s102.c | 4 +-- drivers/iio/gyro/bmg160_i2c.c | 4 +-- drivers/iio/humidity/hts221_i2c.c | 4 +-- drivers/iio/imu/fxos8700_i2c.c | 3 +- drivers/iio/imu/fxos8700_spi.c | 3 +- drivers/iio/imu/kmx61.c | 2 +- drivers/iio/light/jsa1212.c | 4 +-- drivers/iio/light/ltr501.c | 3 +- drivers/iio/light/max44000.c | 6 ++-- drivers/iio/light/rpr0521.c | 4 +-- drivers/iio/light/stk3310.c | 4 +-- drivers/iio/light/us5182d.c | 4 +-- drivers/iio/magnetometer/bmc150_magn_i2c.c | 3 +- drivers/iio/magnetometer/bmc150_magn_spi.c | 3 +- drivers/iio/magnetometer/mmc35240.c | 4 +-- drivers/iio/potentiometer/max5487.c | 4 +-- drivers/iio/pressure/hp206c.c | 6 ++-- drivers/iio/pressure/st_pressure_i2c.c | 5 +--- 28 files changed, 60 insertions(+), 75 deletions(-)--
2.43.0