* [PATCH 00/24] IIO: Clean up ACPI_PTR() usage.
@ 2023-12-31 18:34 Jonathan Cameron
2023-12-31 18:34 ` [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR() Jonathan Cameron
` (24 more replies)
0 siblings, 25 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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(-)
--
2.43.0
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR()
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2024-01-01 13:24 ` Hans de Goede
2023-12-31 18:34 ` [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI Jonathan Cameron
` (23 subsequent siblings)
24 siblings, 1 reply; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio
Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot,
Hans de Goede
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(-)
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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
2023-12-31 18:34 ` [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR() Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2024-01-01 13:24 ` Hans de Goede
2024-01-01 23:33 ` Andy Shevchenko
2023-12-31 18:34 ` [PATCH 03/24] iio: accel: mma9551: Drop ACPI_PTR() usage Jonathan Cameron
` (22 subsequent siblings)
24 siblings, 2 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Hans de Goede
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Hans de Goede <hdegoede@redhat.com>
---
drivers/iio/accel/kxcjk-1013.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index 894709286b0c..7f084f73da84 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -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},
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 03/24] iio: accel: mma9551: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
2023-12-31 18:34 ` [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR() Jonathan Cameron
2023-12-31 18:34 ` [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2023-12-31 18:34 ` [PATCH 04/24] iio: accel: mma9553: " Jonathan Cameron
` (21 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/accel/mma9551.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c
index d823f2edc6d4..083c08f65baf 100644
--- a/drivers/iio/accel/mma9551.c
+++ b/drivers/iio/accel/mma9551.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 04/24] iio: accel: mma9553: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (2 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 03/24] iio: accel: mma9551: Drop ACPI_PTR() usage Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2023-12-31 18:34 ` [PATCH 05/24] iio: accel: mxc4005: " Jonathan Cameron
` (20 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/accel/mma9553.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
index d01aba4aecba..3cbd0fd4e624 100644
--- a/drivers/iio/accel/mma9553.c
+++ b/drivers/iio/accel/mma9553.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 05/24] iio: accel: mxc4005: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (3 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 04/24] iio: accel: mma9553: " Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2024-01-01 23:39 ` Andy Shevchenko
2023-12-31 18:34 ` [PATCH 06/24] iio: accel: mxc6255: " Jonathan Cameron
` (19 subsequent siblings)
24 siblings, 1 reply; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311181952.1usxCcup-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/accel/mxc4005.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/accel/mxc4005.c b/drivers/iio/accel/mxc4005.c
index 82e8d0b39049..8118cc13614a 100644
--- a/drivers/iio/accel/mxc4005.c
+++ b/drivers/iio/accel/mxc4005.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 06/24] iio: accel: mxc6255: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (4 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 05/24] iio: accel: mxc4005: " Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2023-12-31 18:34 ` [PATCH 07/24] iio: accel: stk8ba50: " Jonathan Cameron
` (18 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
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(-)
diff --git a/drivers/iio/accel/mxc6255.c b/drivers/iio/accel/mxc6255.c
index 33c2253561e6..ac228128c4f9 100644
--- a/drivers/iio/accel/mxc6255.c
+++ b/drivers/iio/accel/mxc6255.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 07/24] iio: accel: stk8ba50: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (5 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 06/24] iio: accel: mxc6255: " Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2023-12-31 18:34 ` [PATCH 08/24] iio: accel: bmc150: Drop ACPI_PTR() Jonathan Cameron
` (17 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/accel/stk8ba50.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c
index 3415ac1b4495..668edc88c89d 100644
--- a/drivers/iio/accel/stk8ba50.c
+++ b/drivers/iio/accel/stk8ba50.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 08/24] iio: accel: bmc150: Drop ACPI_PTR()
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (6 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 07/24] iio: accel: stk8ba50: " Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2023-12-31 18:34 ` [PATCH 09/24] iio: gyro: bmg160: Drop ACPI_PTR() usage Jonathan Cameron
` (16 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/accel/bmc150-accel-i2c.c | 2 +-
drivers/iio/accel/bmc150-accel-spi.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index ee1ba134ad42..f08594b372cf 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -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,
diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c
index 921fb46be0b8..a6b9f599eb7b 100644
--- a/drivers/iio/accel/bmc150-accel-spi.c
+++ b/drivers/iio/accel/bmc150-accel-spi.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 09/24] iio: gyro: bmg160: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (7 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 08/24] iio: accel: bmc150: Drop ACPI_PTR() Jonathan Cameron
@ 2023-12-31 18:34 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 10/24] iio: humidity: hts221: " Jonathan Cameron
` (15 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:34 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Mike Looijmans
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
---
drivers/iio/gyro/bmg160_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
index 2f9675596138..9c8e20c25e96 100644
--- a/drivers/iio/gyro/bmg160_i2c.c
+++ b/drivers/iio/gyro/bmg160_i2c.c
@@ -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,
},
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 10/24] iio: humidity: hts221: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (8 preceding siblings ...)
2023-12-31 18:34 ` [PATCH 09/24] iio: gyro: bmg160: Drop ACPI_PTR() usage Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 11/24] iio: imu: fxos8700: " Jonathan Cameron
` (14 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/humidity/hts221_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/humidity/hts221_i2c.c b/drivers/iio/humidity/hts221_i2c.c
index 30f2068ea156..5cb263e0ef5a 100644
--- a/drivers/iio/humidity/hts221_i2c.c
+++ b/drivers/iio/humidity/hts221_i2c.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 11/24] iio: imu: fxos8700: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (9 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 10/24] iio: humidity: hts221: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 12/24] iio: imu: kmx61: " Jonathan Cameron
` (13 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio
Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot, Carlos Song
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311231427.vEQAuxvI-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Carlos Song <carlos.song@nxp.com>
---
drivers/iio/imu/fxos8700_i2c.c | 3 +--
drivers/iio/imu/fxos8700_spi.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/imu/fxos8700_i2c.c b/drivers/iio/imu/fxos8700_i2c.c
index 2ace306d0f9a..e99677ad96a2 100644
--- a/drivers/iio/imu/fxos8700_i2c.c
+++ b/drivers/iio/imu/fxos8700_i2c.c
@@ -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,
diff --git a/drivers/iio/imu/fxos8700_spi.c b/drivers/iio/imu/fxos8700_spi.c
index 27e694cce173..6b0dc7a776b9 100644
--- a/drivers/iio/imu/fxos8700_spi.c
+++ b/drivers/iio/imu/fxos8700_spi.c
@@ -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",
},
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 12/24] iio: imu: kmx61: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (10 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 11/24] iio: imu: fxos8700: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 13/24] iio: light: jsa1212: " Jonathan Cameron
` (12 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/imu/kmx61.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
index 958167b31241..7d3e061f3046 100644
--- a/drivers/iio/imu/kmx61.c
+++ b/drivers/iio/imu/kmx61.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 13/24] iio: light: jsa1212: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (11 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 12/24] iio: imu: kmx61: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 14/24] iio: light: ltr501: " Jonathan Cameron
` (11 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/light/jsa1212.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c
index 37e2807041a1..869196746045 100644
--- a/drivers/iio/light/jsa1212.c
+++ b/drivers/iio/light/jsa1212.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 14/24] iio: light: ltr501: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (12 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 13/24] iio: light: jsa1212: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 15/24] iio: light: rpr0521: " Jonathan Cameron
` (10 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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)
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/light/ltr501.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 061c122fdc5e..8c516ede9116 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 15/24] iio: light: rpr0521: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (13 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 14/24] iio: light: ltr501: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 16/24] iio: light: stk3310: " Jonathan Cameron
` (9 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/light/rpr0521.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
index bbb8581622f2..40d5732b5e32 100644
--- a/drivers/iio/light/rpr0521.c
+++ b/drivers/iio/light/rpr0521.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 16/24] iio: light: stk3310: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (14 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 15/24] iio: light: rpr0521: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 17/24] iio: light: us5182d: " Jonathan Cameron
` (8 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
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(-)
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index 72b08d870d33..7b71ad71d78d 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 17/24] iio: light: us5182d: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (15 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 16/24] iio: light: stk3310: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 18/24] iio: magnetometer: bmc150: " Jonathan Cameron
` (7 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311190738.gldzuIXo-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/light/us5182d.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c
index 61b3b2aea626..9189a1d4d7e1 100644
--- a/drivers/iio/light/us5182d.c
+++ b/drivers/iio/light/us5182d.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 18/24] iio: magnetometer: bmc150: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (16 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 17/24] iio: light: us5182d: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 19/24] iio: magnetometer: mmc35240: " Jonathan Cameron
` (6 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312040109.Csnmqnb2-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202311171116.47sUbZV5-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/magnetometer/bmc150_magn_i2c.c | 3 +--
drivers/iio/magnetometer/bmc150_magn_spi.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/magnetometer/bmc150_magn_i2c.c b/drivers/iio/magnetometer/bmc150_magn_i2c.c
index 281d1fa31c8e..48d9c698f520 100644
--- a/drivers/iio/magnetometer/bmc150_magn_i2c.c
+++ b/drivers/iio/magnetometer/bmc150_magn_i2c.c
@@ -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,
diff --git a/drivers/iio/magnetometer/bmc150_magn_spi.c b/drivers/iio/magnetometer/bmc150_magn_spi.c
index 882987721071..abc75a05c46a 100644
--- a/drivers/iio/magnetometer/bmc150_magn_spi.c
+++ b/drivers/iio/magnetometer/bmc150_magn_spi.c
@@ -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",
},
};
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 19/24] iio: magnetometer: mmc35240: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (17 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 18/24] iio: magnetometer: bmc150: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 20/24] iio: potentiometer: max5487: " Jonathan Cameron
` (5 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/magnetometer/mmc35240.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c
index b495b8a63928..6b9f4b056191 100644
--- a/drivers/iio/magnetometer/mmc35240.c
+++ b/drivers/iio/magnetometer/mmc35240.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 20/24] iio: potentiometer: max5487: Drop ACPI_PTR() usage
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (18 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 19/24] iio: magnetometer: mmc35240: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 21/24] iio: st_sensors: drop ACPI_PTR() and CONFIG_ACPI guards Jonathan Cameron
` (4 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
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(-)
diff --git a/drivers/iio/potentiometer/max5487.c b/drivers/iio/potentiometer/max5487.c
index 42723c996c9f..4838d2e72f53 100644
--- a/drivers/iio/potentiometer/max5487.c
+++ b/drivers/iio/potentiometer/max5487.c
@@ -5,8 +5,8 @@
* Copyright (C) 2016 Cristina-Gabriela Moraru <cristina.moraru09@gmail.com>
*/
#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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 21/24] iio: st_sensors: drop ACPI_PTR() and CONFIG_ACPI guards
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (19 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 20/24] iio: potentiometer: max5487: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 22/24] iio: pressure: hp206c: " Jonathan Cameron
` (3 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Linus Walleij, Denis CIOCCA
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis CIOCCA <denis.ciocca@st.com>
---
drivers/iio/accel/st_accel_i2c.c | 5 +----
drivers/iio/pressure/st_pressure_i2c.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index 71ee861b2980..fd3749871121 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -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,
diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
index 5101552e3f38..389523d6ae32 100644
--- a/drivers/iio/pressure/st_pressure_i2c.c
+++ b/drivers/iio/pressure/st_pressure_i2c.c
@@ -7,7 +7,6 @@
* Denis Ciocca <denis.ciocca@st.com>
*/
-#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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 22/24] iio: pressure: hp206c: drop ACPI_PTR() and CONFIG_ACPI guards
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (20 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 21/24] iio: st_sensors: drop ACPI_PTR() and CONFIG_ACPI guards Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 23/24] iio: light: max44000: " Jonathan Cameron
` (2 subsequent siblings)
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/pressure/hp206c.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/pressure/hp206c.c b/drivers/iio/pressure/hp206c.c
index a072de6cb59c..261af1562827 100644
--- a/drivers/iio/pressure/hp206c.c
+++ b/drivers/iio/pressure/hp206c.c
@@ -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,
},
};
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 23/24] iio: light: max44000: drop ACPI_PTR() and CONFIG_ACPI guards
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (21 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 22/24] iio: pressure: hp206c: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2023-12-31 18:35 ` [PATCH 24/24] iio: adc: ti-adc109s102: " Jonathan Cameron
2024-01-01 23:48 ` [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Andy Shevchenko
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/light/max44000.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c
index db96c5b73100..26b464b1b650 100644
--- a/drivers/iio/light/max44000.c
+++ b/drivers/iio/light/max44000.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH 24/24] iio: adc: ti-adc109s102: drop ACPI_PTR() and CONFIG_ACPI guards
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (22 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 23/24] iio: light: max44000: " Jonathan Cameron
@ 2023-12-31 18:35 ` Jonathan Cameron
2024-01-01 23:48 ` [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Andy Shevchenko
24 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2023-12-31 18:35 UTC (permalink / raw)
To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
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.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
drivers/iio/adc/ti-adc108s102.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/adc/ti-adc108s102.c b/drivers/iio/adc/ti-adc108s102.c
index c82a161630e1..69fcbbc7e418 100644
--- a/drivers/iio/adc/ti-adc108s102.c
+++ b/drivers/iio/adc/ti-adc108s102.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR()
2023-12-31 18:34 ` [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR() Jonathan Cameron
@ 2024-01-01 13:24 ` Hans de Goede
0 siblings, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2024-01-01 13:24 UTC (permalink / raw)
To: Jonathan Cameron, linux-iio
Cc: Andy Shevchenko, Jonathan Cameron, kernel test robot
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,
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI
2023-12-31 18:34 ` [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI Jonathan Cameron
@ 2024-01-01 13:24 ` Hans de Goede
2024-01-01 23:33 ` Andy Shevchenko
1 sibling, 0 replies; 31+ messages in thread
From: Hans de Goede @ 2024-01-01 13:24 UTC (permalink / raw)
To: Jonathan Cameron, linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron
Hi,
On 12/31/23 19:34, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> 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.
>
> 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/kxcjk-1013.c | 33 +++++++++++++++++----------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index 894709286b0c..7f084f73da84 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -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},
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI
2023-12-31 18:34 ` [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI Jonathan Cameron
2024-01-01 13:24 ` Hans de Goede
@ 2024-01-01 23:33 ` Andy Shevchenko
1 sibling, 0 replies; 31+ messages in thread
From: Andy Shevchenko @ 2024-01-01 23:33 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Jonathan Cameron, Hans de Goede
On Sun, Dec 31, 2023 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> 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.
...
> +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},
> + { },
Can you drop the comma, while at it?
> +};
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 05/24] iio: accel: mxc4005: Drop ACPI_PTR() usage
2023-12-31 18:34 ` [PATCH 05/24] iio: accel: mxc4005: " Jonathan Cameron
@ 2024-01-01 23:39 ` Andy Shevchenko
0 siblings, 0 replies; 31+ messages in thread
From: Andy Shevchenko @ 2024-01-01 23:39 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Jonathan Cameron, kernel test robot
On Sun, Dec 31, 2023 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> 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.
ACPI
(and in other commit messages that repeat this text)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 00/24] IIO: Clean up ACPI_PTR() usage.
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
` (23 preceding siblings ...)
2023-12-31 18:35 ` [PATCH 24/24] iio: adc: ti-adc109s102: " Jonathan Cameron
@ 2024-01-01 23:48 ` Andy Shevchenko
2024-01-07 16:41 ` Jonathan Cameron
24 siblings, 1 reply; 31+ messages in thread
From: Andy Shevchenko @ 2024-01-01 23:48 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Jonathan Cameron
On Sun, Dec 31, 2023 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> 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.
Long awaited series, thanks for doing it!
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(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.
> 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(-)
>
> --
> 2.43.0
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 00/24] IIO: Clean up ACPI_PTR() usage.
2024-01-01 23:48 ` [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Andy Shevchenko
@ 2024-01-07 16:41 ` Jonathan Cameron
0 siblings, 0 replies; 31+ messages in thread
From: Jonathan Cameron @ 2024-01-07 16:41 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-iio, Jonathan Cameron
On Tue, 2 Jan 2024 01:48:07 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Sun, Dec 31, 2023 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > 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.
>
> Long awaited series, thanks for doing it!
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> (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!
>
> 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.
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
>
> > 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(-)
> >
> > --
> > 2.43.0
> >
>
>
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2024-01-07 16:41 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-31 18:34 [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Jonathan Cameron
2023-12-31 18:34 ` [PATCH 01/24] iio: accel: da280: Stop using ACPI_PTR() Jonathan Cameron
2024-01-01 13:24 ` Hans de Goede
2023-12-31 18:34 ` [PATCH 02/24] iio: accel: kxcjk-1013: Move acpi_device_id table under ifdef CONFIG_ACPI Jonathan Cameron
2024-01-01 13:24 ` Hans de Goede
2024-01-01 23:33 ` Andy Shevchenko
2023-12-31 18:34 ` [PATCH 03/24] iio: accel: mma9551: Drop ACPI_PTR() usage Jonathan Cameron
2023-12-31 18:34 ` [PATCH 04/24] iio: accel: mma9553: " Jonathan Cameron
2023-12-31 18:34 ` [PATCH 05/24] iio: accel: mxc4005: " Jonathan Cameron
2024-01-01 23:39 ` Andy Shevchenko
2023-12-31 18:34 ` [PATCH 06/24] iio: accel: mxc6255: " Jonathan Cameron
2023-12-31 18:34 ` [PATCH 07/24] iio: accel: stk8ba50: " Jonathan Cameron
2023-12-31 18:34 ` [PATCH 08/24] iio: accel: bmc150: Drop ACPI_PTR() Jonathan Cameron
2023-12-31 18:34 ` [PATCH 09/24] iio: gyro: bmg160: Drop ACPI_PTR() usage Jonathan Cameron
2023-12-31 18:35 ` [PATCH 10/24] iio: humidity: hts221: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 11/24] iio: imu: fxos8700: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 12/24] iio: imu: kmx61: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 13/24] iio: light: jsa1212: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 14/24] iio: light: ltr501: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 15/24] iio: light: rpr0521: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 16/24] iio: light: stk3310: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 17/24] iio: light: us5182d: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 18/24] iio: magnetometer: bmc150: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 19/24] iio: magnetometer: mmc35240: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 20/24] iio: potentiometer: max5487: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 21/24] iio: st_sensors: drop ACPI_PTR() and CONFIG_ACPI guards Jonathan Cameron
2023-12-31 18:35 ` [PATCH 22/24] iio: pressure: hp206c: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 23/24] iio: light: max44000: " Jonathan Cameron
2023-12-31 18:35 ` [PATCH 24/24] iio: adc: ti-adc109s102: " Jonathan Cameron
2024-01-01 23:48 ` [PATCH 00/24] IIO: Clean up ACPI_PTR() usage Andy Shevchenko
2024-01-07 16:41 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox