[48/57] staging: comedi: drivers: jr3_pci: Remove set but unused variable 'min_full_scale'
diff mbox series

Message ID 20210414181129.1628598-49-lee.jones@linaro.org
State New, archived
Headers show
Series
  • Rid W=1 warnings from Staging
Related show

Commit Message

Lee Jones April 14, 2021, 6:11 p.m. UTC
Fixes the following W=1 kernel build warning(s):

 drivers/staging/comedi/drivers/jr3_pci.c: In function ‘jr3_pci_poll_subdevice’:
 drivers/staging/comedi/drivers/jr3_pci.c:507:22: warning: variable ‘min_full_scale’ set but not used [-Wunused-but-set-variable]

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Alexander A. Klimov" <grandmaster@al2klimov.de>
Cc: Anders Blomdell <anders.blomdell@control.lth.se>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/staging/comedi/drivers/jr3_pci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ian Abbott April 15, 2021, 9:33 a.m. UTC | #1
On 14/04/2021 19:11, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>   drivers/staging/comedi/drivers/jr3_pci.c: In function ‘jr3_pci_poll_subdevice’:
>   drivers/staging/comedi/drivers/jr3_pci.c:507:22: warning: variable ‘min_full_scale’ set but not used [-Wunused-but-set-variable]
> 
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Alexander A. Klimov" <grandmaster@al2klimov.de>
> Cc: Anders Blomdell <anders.blomdell@control.lth.se>
> Cc: linux-staging@lists.linux.dev
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>   drivers/staging/comedi/drivers/jr3_pci.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
> index 7a02c4fa3cda8..afa2f8d5c8c0c 100644
> --- a/drivers/staging/comedi/drivers/jr3_pci.c
> +++ b/drivers/staging/comedi/drivers/jr3_pci.c
> @@ -504,10 +504,9 @@ jr3_pci_poll_subdevice(struct comedi_subdevice *s)
>   			result = poll_delay_min_max(20, 100);
>   		} else {
>   			/* Set full scale */
> -			struct six_axis_t min_full_scale;
>   			struct six_axis_t max_full_scale;
>   
> -			min_full_scale = get_min_full_scales(sensor);
> +			get_min_full_scales(sensor);
>   			max_full_scale = get_max_full_scales(sensor);
>   			set_full_scales(sensor, max_full_scale);
>   
> 

get_min_full_scales() could be removed altogether.  It was only being 
called originally so the driver could printk the values, but those 
printks have since been removed.
Lee Jones April 15, 2021, 9:52 a.m. UTC | #2
On Thu, 15 Apr 2021, Ian Abbott wrote:

> On 14/04/2021 19:11, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> > 
> >   drivers/staging/comedi/drivers/jr3_pci.c: In function ‘jr3_pci_poll_subdevice’:
> >   drivers/staging/comedi/drivers/jr3_pci.c:507:22: warning: variable ‘min_full_scale’ set but not used [-Wunused-but-set-variable]
> > 
> > Cc: Ian Abbott <abbotti@mev.co.uk>
> > Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: "Alexander A. Klimov" <grandmaster@al2klimov.de>
> > Cc: Anders Blomdell <anders.blomdell@control.lth.se>
> > Cc: linux-staging@lists.linux.dev
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> >   drivers/staging/comedi/drivers/jr3_pci.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
> > index 7a02c4fa3cda8..afa2f8d5c8c0c 100644
> > --- a/drivers/staging/comedi/drivers/jr3_pci.c
> > +++ b/drivers/staging/comedi/drivers/jr3_pci.c
> > @@ -504,10 +504,9 @@ jr3_pci_poll_subdevice(struct comedi_subdevice *s)
> >   			result = poll_delay_min_max(20, 100);
> >   		} else {
> >   			/* Set full scale */
> > -			struct six_axis_t min_full_scale;
> >   			struct six_axis_t max_full_scale;
> > -			min_full_scale = get_min_full_scales(sensor);
> > +			get_min_full_scales(sensor);
> >   			max_full_scale = get_max_full_scales(sensor);
> >   			set_full_scales(sensor, max_full_scale);
> > 
> 
> get_min_full_scales() could be removed altogether.  It was only being called
> originally so the driver could printk the values, but those printks have
> since been removed.

Even better.  Thanks Ian.

Patch
diff mbox series

diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index 7a02c4fa3cda8..afa2f8d5c8c0c 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -504,10 +504,9 @@  jr3_pci_poll_subdevice(struct comedi_subdevice *s)
 			result = poll_delay_min_max(20, 100);
 		} else {
 			/* Set full scale */
-			struct six_axis_t min_full_scale;
 			struct six_axis_t max_full_scale;
 
-			min_full_scale = get_min_full_scales(sensor);
+			get_min_full_scales(sensor);
 			max_full_scale = get_max_full_scales(sensor);
 			set_full_scales(sensor, max_full_scale);