Message ID | 20200717165538.3275050-30-lee.jones@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Second batch of W=1 fixes for IIO | expand |
On Fri, 17 Jul 2020 17:55:37 +0100 Lee Jones <lee.jones@linaro.org> wrote: > It doesn't make sense to move it into '*core*' as it's co-located with > other, similar definitions which are used in multiple locations. > > Fixes the following W=1 kernel build warning(s): > > In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c:17: > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h:497:44: warning: ‘st_lsm6dsx_accel_ext_info’ defined but not used [-Wunused-const-variable=] > 497 | static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c:17: > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h:497:44: warning: ‘st_lsm6dsx_accel_ext_info’ defined but not used [-Wunused-const-variable=] > 497 | static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c:16: > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h:497:44: warning: ‘st_lsm6dsx_accel_ext_info’ defined but not used [-Wunused-const-variable=] > 497 | static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > > Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> > Cc: Denis Ciocca <denis.ciocca@st.com> > Signed-off-by: Lee Jones <lee.jones@linaro.org> Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h > index 3e47a9287938b..d82ec6398222f 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h > @@ -494,7 +494,8 @@ st_lsm6dsx_get_mount_matrix(const struct iio_dev *iio_dev, > return &hw->orientation; > } > > -static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { > +static const > +struct iio_chan_spec_ext_info __maybe_unused st_lsm6dsx_accel_ext_info[] = { > IIO_MOUNT_MATRIX(IIO_SHARED_BY_ALL, st_lsm6dsx_get_mount_matrix), > { } > };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h index 3e47a9287938b..d82ec6398222f 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h @@ -494,7 +494,8 @@ st_lsm6dsx_get_mount_matrix(const struct iio_dev *iio_dev, return &hw->orientation; } -static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { +static const +struct iio_chan_spec_ext_info __maybe_unused st_lsm6dsx_accel_ext_info[] = { IIO_MOUNT_MATRIX(IIO_SHARED_BY_ALL, st_lsm6dsx_get_mount_matrix), { } };
It doesn't make sense to move it into '*core*' as it's co-located with other, similar definitions which are used in multiple locations. Fixes the following W=1 kernel build warning(s): In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c:17: drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h:497:44: warning: ‘st_lsm6dsx_accel_ext_info’ defined but not used [-Wunused-const-variable=] 497 | static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { | ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c:17: drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h:497:44: warning: ‘st_lsm6dsx_accel_ext_info’ defined but not used [-Wunused-const-variable=] 497 | static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { | ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c:16: drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h:497:44: warning: ‘st_lsm6dsx_accel_ext_info’ defined but not used [-Wunused-const-variable=] 497 | static const struct iio_chan_spec_ext_info st_lsm6dsx_accel_ext_info[] = { | ^~~~~~~~~~~~~~~~~~~~~~~~~ Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)