iio: pressure: st_press: Mark default_press_pdata with __maybe_unused
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 16 Dec 2019 17:38:50 +0000 (19:38 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 29 Dec 2019 15:20:05 +0000 (15:20 +0000)
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 default_press_pdata with __maybe_unused to calm a compiler down:

In file included from drivers/iio/pressure/st_pressure_spi.c:18:
drivers/iio/pressure/st_pressure.h:40:46: warning: ‘default_press_pdata’ defined but not used [-Wunused-const-variable=]
   40 | static const struct st_sensors_platform_data default_press_pdata = {
      |                                              ^~~~~~~~~~~~~~~~~~~
...

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/st_pressure.h

index c2e47a6c31187b99219c579056371d8add4acc94..5c746ff6087e04946dfdee2ee0b6b74b89860383 100644 (file)
@@ -37,7 +37,7 @@ enum st_press_type {
  * struct st_sensors_platform_data - default press platform data
  * @drdy_int_pin: default press DRDY is available on INT1 pin.
  */
-static const struct st_sensors_platform_data default_press_pdata = {
+static __maybe_unused const struct st_sensors_platform_data default_press_pdata = {
        .drdy_int_pin = 1,
 };