Skip to contentSkip to conversation

iio: accel: mma7660: Mark acpi match table as maybe unused

PATCH In review Daniel Palmer 2 participants 2 messages Sep 19, 2021 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: accel: mma7660: Mark acpi match table as maybe unused

When building kernels without ACPI support the table is declared but is not used because ACPI_PTR() turns it into a NULL.

Add the __maybe_unused attribute to stop the compiler whining.

---
 drivers/iio/accel/mma7660.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/mma7660.c +1 -1
index 47f5cd66e996..cd6cdf2c51b0 100644
@@ -254,7 +254,7 @@ static const struct of_device_id mma7660_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mma7660_of_match);
 
-static const struct acpi_device_id mma7660_acpi_id[] = {
+static const struct acpi_device_id __maybe_unused mma7660_acpi_id[] = {
 	{"MMA7660", 0},
 	{}
 };
Signature · 1 line
2.33.0
maintainer
#1 lore raw
Quoted 6 lines · On Sun, 19 Sep 2021 16:26:16 +0900 Daniel Palmer <[email protected]> wrote:

When building kernels without ACPI support the table is declared but is not used because ACPI_PTR() turns it into a NULL.

Add the __maybe_unused attribute to stop the compiler whining.

Applied to the togreg branch of iio.git which is initially pushed out as testing to let 0-day poke at it and see if we missed anything.

Thanks,

Jonathan

Quoted 17 lines
---
 drivers/iio/accel/mma7660.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/mma7660.c +1 -1
index 47f5cd66e996..cd6cdf2c51b0 100644
@@ -254,7 +254,7 @@ static const struct of_device_id mma7660_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mma7660_of_match);
 
-static const struct acpi_device_id mma7660_acpi_id[] = {
+static const struct acpi_device_id __maybe_unused mma7660_acpi_id[] = {
 	{"MMA7660", 0},
 	{}
 };