diff mbox series

[-next] iio: imu: st_lsm6dsx: remove set but not used variable ''

Message ID 1544855484-154231-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] iio: imu: st_lsm6dsx: remove set but not used variable '' | expand

Commit Message

Yue Haibing Dec. 15, 2018, 6:31 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c: In function 'st_lsm6dsx_shub_read_reg':
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c:108:41: warning:
 variable 'hub_settings' set but not used [-Wunused-but-set-variable]

It never used since introduction in commit c91c1c844ebd ("iio: imu: st_lsm6dsx:
add i2c embedded controller support")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Lorenzo Bianconi Dec. 15, 2018, 8:24 a.m. UTC | #1
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c: In function 'st_lsm6dsx_shub_read_reg':
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c:108:41: warning:
>  variable 'hub_settings' set but not used [-Wunused-but-set-variable]
>
> It never used since introduction in commit c91c1c844ebd ("iio: imu: st_lsm6dsx:
> add i2c embedded controller support")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> index 8e47dcc..66fbcd9 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> @@ -105,12 +105,10 @@ static void st_lsm6dsx_shub_wait_complete(struct st_lsm6dsx_hw *hw)
>  static int st_lsm6dsx_shub_read_reg(struct st_lsm6dsx_hw *hw, u8 addr,
>                                     u8 *data, int len)
>  {
> -       const struct st_lsm6dsx_shub_settings *hub_settings;
>         int err;
>
>         mutex_lock(&hw->page_lock);
>
> -       hub_settings = &hw->settings->shub_settings;
>         err = st_lsm6dsx_set_page(hw, true);
>         if (err < 0)
>                 goto out;
>
>
>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Jonathan Cameron Dec. 16, 2018, 2:16 p.m. UTC | #2
On Sat, 15 Dec 2018 09:24:57 +0100
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:

> >
> > Fixes gcc '-Wunused-but-set-variable' warning:
> >
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c: In function 'st_lsm6dsx_shub_read_reg':
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c:108:41: warning:
> >  variable 'hub_settings' set but not used [-Wunused-but-set-variable]
> >
> > It never used since introduction in commit c91c1c844ebd ("iio: imu: st_lsm6dsx:
> > add i2c embedded controller support")
> >
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> > index 8e47dcc..66fbcd9 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> > @@ -105,12 +105,10 @@ static void st_lsm6dsx_shub_wait_complete(struct st_lsm6dsx_hw *hw)
> >  static int st_lsm6dsx_shub_read_reg(struct st_lsm6dsx_hw *hw, u8 addr,
> >                                     u8 *data, int len)
> >  {
> > -       const struct st_lsm6dsx_shub_settings *hub_settings;
> >         int err;
> >
> >         mutex_lock(&hw->page_lock);
> >
> > -       hub_settings = &hw->settings->shub_settings;
> >         err = st_lsm6dsx_set_page(hw, true);
> >         if (err < 0)
> >                 goto out;
> >
> >
> >  
> Acked-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan
diff mbox series

Patch

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
index 8e47dcc..66fbcd9 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
@@ -105,12 +105,10 @@  static void st_lsm6dsx_shub_wait_complete(struct st_lsm6dsx_hw *hw)
 static int st_lsm6dsx_shub_read_reg(struct st_lsm6dsx_hw *hw, u8 addr,
 				    u8 *data, int len)
 {
-	const struct st_lsm6dsx_shub_settings *hub_settings;
 	int err;
 
 	mutex_lock(&hw->page_lock);
 
-	hub_settings = &hw->settings->shub_settings;
 	err = st_lsm6dsx_set_page(hw, true);
 	if (err < 0)
 		goto out;