public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / 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
  2019-04-09  2:12 ` [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor' YueHaibing
  0 siblings, 2 replies; 6+ 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 related	[flat|nested] 6+ 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
  2019-04-09  2:12 ` [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor' YueHaibing
  1 sibling, 1 reply; 6+ 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] 6+ 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; 6+ 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] 6+ messages in thread

* [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor'
  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
@ 2019-04-09  2:12 ` YueHaibing
  2019-04-09  8:24   ` [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sen Lorenzo Bianconi
  1 sibling, 1 reply; 6+ messages in thread
From: YueHaibing @ 2019-04-09  2:12 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_buffer.c: In function 'st_lsm6dsx_read_tagged_fifo':
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:41: warning:
 variable 'gyro_sensor' set but not used [-Wunused-but-set-variable]

drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:28: warning:
 variable 'acc_sensor' set but not used [-Wunused-but-set-variable]

They are not used since commit 14c7c6e1a860 ("iio: imu: st_lsm6dsx: add
st_lsm6dsx_push_tagged_data routine")

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

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 2da8c5ff699a..bd08711d5b75 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -517,7 +517,6 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)
 {
 	u16 pattern_len = hw->sip * ST_LSM6DSX_TAGGED_SAMPLE_SIZE;
 	u16 fifo_len, fifo_diff_mask;
-	struct st_lsm6dsx_sensor *acc_sensor, *gyro_sensor;
 	u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE], tag;
 	bool reset_ts = false;
 	int i, err, read_len;
@@ -539,9 +538,6 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)
 	if (!fifo_len)
 		return 0;
 
-	acc_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_ACC]);
-	gyro_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_GYRO]);
-
 	for (read_len = 0; read_len < fifo_len; read_len += pattern_len) {
 		err = st_lsm6dsx_read_block(hw,
 					    ST_LSM6DSX_REG_FIFO_OUT_TAG_ADDR,

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

* Re: [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sen
  2019-04-09  2:12 ` [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor' YueHaibing
@ 2019-04-09  8:24   ` Lorenzo Bianconi
  2019-04-14 12:40     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Lorenzo Bianconi @ 2019-04-09  8:24 UTC (permalink / raw)
  To: YueHaibing
  Cc: Lorenzo Bianconi, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c: In function 'st_lsm6dsx_read_tagged_fifo':
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:41: warning:
>  variable 'gyro_sensor' set but not used [-Wunused-but-set-variable]
> 
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:28: warning:
>  variable 'acc_sensor' set but not used [-Wunused-but-set-variable]
> 
> They are not used since commit 14c7c6e1a860 ("iio: imu: st_lsm6dsx: add
> st_lsm6dsx_push_tagged_data routine")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index 2da8c5ff699a..bd08711d5b75 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -517,7 +517,6 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)
>  {
>  	u16 pattern_len = hw->sip * ST_LSM6DSX_TAGGED_SAMPLE_SIZE;
>  	u16 fifo_len, fifo_diff_mask;
> -	struct st_lsm6dsx_sensor *acc_sensor, *gyro_sensor;
>  	u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE], tag;
>  	bool reset_ts = false;
>  	int i, err, read_len;
> @@ -539,9 +538,6 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)
>  	if (!fifo_len)
>  		return 0;
>  
> -	acc_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_ACC]);
> -	gyro_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_GYRO]);
> -
>  	for (read_len = 0; read_len < fifo_len; read_len += pattern_len) {
>  		err = st_lsm6dsx_read_block(hw,
>  					    ST_LSM6DSX_REG_FIFO_OUT_TAG_ADDR,
> 
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

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

On Tue, 9 Apr 2019 10:24:49 +0200
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c: In function 'st_lsm6dsx_read_tagged_fifo':
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:41: warning:
> >  variable 'gyro_sensor' set but not used [-Wunused-but-set-variable]
> > 
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:28: warning:
> >  variable 'acc_sensor' set but not used [-Wunused-but-set-variable]
> > 
> > They are not used since commit 14c7c6e1a860 ("iio: imu: st_lsm6dsx: add
> > st_lsm6dsx_push_tagged_data routine")
> > 
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>  
> 
> Acked-by: Lorenzo Bianconi <lorenzo@kernel.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_buffer.c | 4 ----
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > index 2da8c5ff699a..bd08711d5b75 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > @@ -517,7 +517,6 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)
> >  {
> >  	u16 pattern_len = hw->sip * ST_LSM6DSX_TAGGED_SAMPLE_SIZE;
> >  	u16 fifo_len, fifo_diff_mask;
> > -	struct st_lsm6dsx_sensor *acc_sensor, *gyro_sensor;
> >  	u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE], tag;
> >  	bool reset_ts = false;
> >  	int i, err, read_len;
> > @@ -539,9 +538,6 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)
> >  	if (!fifo_len)
> >  		return 0;
> >  
> > -	acc_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_ACC]);
> > -	gyro_sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_GYRO]);
> > -
> >  	for (read_len = 0; read_len < fifo_len; read_len += pattern_len) {
> >  		err = st_lsm6dsx_read_block(hw,
> >  					    ST_LSM6DSX_REG_FIFO_OUT_TAG_ADDR,
> > 
> > 
> >   

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

end of thread, other threads:[~2019-04-14 12:40 UTC | newest]

Thread overview: 6+ 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
2019-04-09  2:12 ` [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor' YueHaibing
2019-04-09  8:24   ` [PATCH -next] iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sen Lorenzo Bianconi
2019-04-14 12:40     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox