From f22b1d7588b1cc115d15462bb0f118be971369fb Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 16 Dec 2019 19:38:48 +0200 Subject: [PATCH] iio: gyro: st_gyro: Mark gyro_pdata with __maybe_unused MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gyro_pdata with __maybe_unused to calm a compiler down: In file included from drivers/iio/gyro/st_gyro_i2c.c:18: drivers/iio/gyro/st_gyro.h:31:46: warning: ‘gyro_pdata’ defined but not used [-Wunused-const-variable=] 31 | static const struct st_sensors_platform_data gyro_pdata = { | ^~~~~~~~~~ ... Signed-off-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/st_gyro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/st_gyro.h b/drivers/iio/gyro/st_gyro.h index 592f6b34e987..fd9171cc3aba 100644 --- a/drivers/iio/gyro/st_gyro.h +++ b/drivers/iio/gyro/st_gyro.h @@ -28,7 +28,7 @@ * struct st_sensors_platform_data - gyro platform data * @drdy_int_pin: DRDY on gyros is available only on INT2 pin. */ -static const struct st_sensors_platform_data gyro_pdata = { +static __maybe_unused const struct st_sensors_platform_data gyro_pdata = { .drdy_int_pin = 2, }; -- 2.25.1