2021-05-20 13:02:56

by Lee Jones

[permalink] [raw]
Subject: [PATCH 2/6] comedi: drivers: jr3_pci: Remove set but unused variable 'min_full_scale'

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 <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Alexander A. Klimov" <[email protected]>
Cc: Anders Blomdell <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/comedi/drivers/jr3_pci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/comedi/drivers/jr3_pci.c b/drivers/comedi/drivers/jr3_pci.c
index 7a02c4fa3cda8..afa2f8d5c8c0c 100644
--- a/drivers/comedi/drivers/jr3_pci.c
+++ b/drivers/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);

--
2.31.1


2021-05-20 13:24:59

by Ian Abbott

[permalink] [raw]
Subject: Re: [PATCH 2/6] comedi: drivers: jr3_pci: Remove set but unused variable 'min_full_scale'

On 20/05/2021 13:25, 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 <[email protected]>
> Cc: H Hartley Sweeten <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: "Alexander A. Klimov" <[email protected]>
> Cc: Anders Blomdell <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/comedi/drivers/jr3_pci.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

Actually, that one is stale now (or will be when Greg's staging-next
branch gets merged into linux-next soon):

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?h=staging-next&id=b9f38e913a926b455e5048a95f53a993b515509f

| staging: comedi: Remove unused variable ‘min_full_scale’ and function
'get_min_full_scales'
|
| The variable ‘min_full_scale’ and function 'get_min_full_scales' are
| not used, So delete them.

--
-=( Ian Abbott <[email protected]> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || http://www.mev.co.uk )=-

2021-05-21 20:08:40

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 2/6] comedi: drivers: jr3_pci: Remove set but unused variable 'min_full_scale'

On Thu, 20 May 2021, Ian Abbott wrote:

> On 20/05/2021 13:25, 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 <[email protected]>
> > Cc: H Hartley Sweeten <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: "Alexander A. Klimov" <[email protected]>
> > Cc: Anders Blomdell <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/comedi/drivers/jr3_pci.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
>
> Actually, that one is stale now (or will be when Greg's staging-next branch
> gets merged into linux-next soon):
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?h=staging-next&id=b9f38e913a926b455e5048a95f53a993b515509f
>
> | staging: comedi: Remove unused variable ‘min_full_scale’ and function
> 'get_min_full_scales'
> |
> | The variable ‘min_full_scale’ and function 'get_min_full_scales' are
> | not used, So delete them.
>

No worries, if it's fixed, it's fixed.

Could you please take the patches that you are happy with.

I'll rework or drop the remainder, thanks.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog