Linux-IIO Archive on lore.kernel.org
 help / Atom feed
* [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variable ''
@ 2018-12-15  6:31 YueHaibing
  2018-12-15  8:24 ` Lorenzo Bianconi
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2018-12-15  6:31 UTC (permalink / raw)
  To: Lorenzo Bianconi, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler
  Cc: YueHaibing, linux-iio, kernel-janitors

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;




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variable ''
  2018-12-15  6:31 [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variable '' YueHaibing
@ 2018-12-15  8:24 ` Lorenzo Bianconi
  2018-12-16 14:16   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Bianconi @ 2018-12-15  8:24 UTC (permalink / raw)
  To: YueHaibing
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors

>
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variable ''
  2018-12-15  8:24 ` Lorenzo Bianconi
@ 2018-12-16 14:16   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2018-12-16 14:16 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: YueHaibing, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15  6:31 [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variable '' YueHaibing
2018-12-15  8:24 ` Lorenzo Bianconi
2018-12-16 14:16   ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox