* [PATCH v2 1/5] staging: gpib: cb7210: remove unused variable
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
@ 2025-02-14 19:54 ` Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 2/5] staging: gpib: eastwood: " Gaston Gonzalez
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gaston Gonzalez @ 2025-02-14 19:54 UTC (permalink / raw)
To: linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel, gascoar
Remove unused variable 'nec_priv' in function 'cb7210_line_status'.
This removes the following warning found compiling with W=1:
warning: variable ‘nec_priv’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
v2: no changes in this patch.
drivers/staging/gpib/cb7210/cb7210.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c
index 381c508f62eb..5c2b2c382df3 100644
--- a/drivers/staging/gpib/cb7210/cb7210.c
+++ b/drivers/staging/gpib/cb7210/cb7210.c
@@ -383,10 +383,8 @@ static int cb7210_line_status(const gpib_board_t *board)
int status = ValidALL;
int bsr_bits;
struct cb7210_priv *cb_priv;
- struct nec7210_priv *nec_priv;
cb_priv = board->private_data;
- nec_priv = &cb_priv->nec7210_priv;
bsr_bits = cb7210_paged_read_byte(cb_priv, BUS_STATUS, BUS_STATUS_PAGE);
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 2/5] staging: gpib: eastwood: remove unused variable
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
@ 2025-02-14 19:54 ` Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 3/5] staging: gpib: ni_usb: " Gaston Gonzalez
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gaston Gonzalez @ 2025-02-14 19:54 UTC (permalink / raw)
To: linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel, gascoar
Remove unused variable 'nec_priv' in function 'fluke_line_status'.
This removes the following warning found compiling with W=1:
warning: variable ‘nec_priv’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
v2: no changes in this patch.
drivers/staging/gpib/eastwood/fluke_gpib.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c
index d5b1a03abf11..65bb79a8fd3c 100644
--- a/drivers/staging/gpib/eastwood/fluke_gpib.c
+++ b/drivers/staging/gpib/eastwood/fluke_gpib.c
@@ -194,10 +194,8 @@ static int fluke_line_status(const gpib_board_t *board)
int status = ValidALL;
int bsr_bits;
struct fluke_priv *e_priv;
- struct nec7210_priv *nec_priv;
e_priv = board->private_data;
- nec_priv = &e_priv->nec7210_priv;
bsr_bits = fluke_paged_read_byte(e_priv, BUS_STATUS, BUS_STATUS_PAGE);
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 3/5] staging: gpib: ni_usb: remove unused variable
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 2/5] staging: gpib: eastwood: " Gaston Gonzalez
@ 2025-02-14 19:54 ` Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Gaston Gonzalez @ 2025-02-14 19:54 UTC (permalink / raw)
To: linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel, gascoar
Remove unused variable 'adr1_bits' in function 'parse_board_ibrd_readback'
Since the value of the variable 'i' is increased when 'adr1_bits' is set, the
'i++' post-increment was added in order to keep the value of 'i' right.
This change removes the following warning:
warning: variable ‘adr1_bits’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
v2: added post-increment 'i++'.
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
index d0656dc520f5..41d9cccdaf10 100644
--- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
@@ -427,7 +427,6 @@ static int parse_board_ibrd_readback(const u8 *raw_data, struct ni_usb_status_bl
int i = 0;
int j = 0;
int k;
- unsigned int adr1_bits;
int num_data_blocks = 0;
struct ni_usb_status_block register_write_status;
int unexpected = 0;
@@ -460,7 +459,7 @@ static int parse_board_ibrd_readback(const u8 *raw_data, struct ni_usb_status_bl
pr_err("%s: bug: status->id=%i, != ibrd_status_id\n", __func__, status->id);
return -EIO;
}
- adr1_bits = raw_data[i++];
+ i++;
if (num_data_blocks) {
*actual_bytes_read = (num_data_blocks - 1) * data_block_length + raw_data[i++];
} else {
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 4/5] staging: gpib: tnt4882: remove unused variable
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
` (2 preceding siblings ...)
2025-02-14 19:54 ` [PATCH v2 3/5] staging: gpib: ni_usb: " Gaston Gonzalez
@ 2025-02-14 19:54 ` Gaston Gonzalez
2025-02-14 19:54 ` [PATCH v2 5/5] staging: gpib: ines: " Gaston Gonzalez
2025-02-16 15:11 ` [PATCH v2 0/5] staging: gpib: remove unused variables Dan Carpenter
5 siblings, 0 replies; 7+ messages in thread
From: Gaston Gonzalez @ 2025-02-14 19:54 UTC (permalink / raw)
To: linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel, gascoar
Remove unused variable 'retval' in function 'tnt4882_update_status'.
A call to nec7210_update_status_nolock() is added as the status bits are written
to board->status in that function.
This change removes the following warning:
warning: variable ‘retval’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
v2: add call to nec7210_update_status_nolock() function.
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index 2e1c3cbebaca..19f6d798f09c 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -704,12 +704,11 @@ static unsigned int tnt4882_update_status(gpib_board_t *board, unsigned int clea
{
unsigned long flags;
u8 line_status;
- unsigned int retval;
struct tnt4882_priv *priv = board->private_data;
spin_lock_irqsave(&board->spinlock, flags);
board->status &= ~clear_mask;
- retval = nec7210_update_status_nolock(board, &priv->nec7210_priv);
+ nec7210_update_status_nolock(board, &priv->nec7210_priv);
/* set / clear SRQ state since it is not cleared by interrupt */
line_status = tnt_readb(priv, BSR);
if (line_status & BCSR_SRQ_BIT)
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 5/5] staging: gpib: ines: remove unused variable
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
` (3 preceding siblings ...)
2025-02-14 19:54 ` [PATCH v2 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
@ 2025-02-14 19:54 ` Gaston Gonzalez
2025-02-16 15:11 ` [PATCH v2 0/5] staging: gpib: remove unused variables Dan Carpenter
5 siblings, 0 replies; 7+ messages in thread
From: Gaston Gonzalez @ 2025-02-14 19:54 UTC (permalink / raw)
To: linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel, gascoar
Remove unused variable 'nec_priv' in function 'ines_line_status'.
This change removes the following warning:
warning: variable ‘nec_priv’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
v2: no changes in this patch.
drivers/staging/gpib/ines/ines_gpib.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c
index 22a05a287bce..ba07dfb0697a 100644
--- a/drivers/staging/gpib/ines/ines_gpib.c
+++ b/drivers/staging/gpib/ines/ines_gpib.c
@@ -26,10 +26,8 @@ int ines_line_status(const gpib_board_t *board)
int status = ValidALL;
int bcm_bits;
struct ines_priv *ines_priv;
- struct nec7210_priv *nec_priv;
ines_priv = board->private_data;
- nec_priv = &ines_priv->nec7210_priv;
bcm_bits = ines_inb(ines_priv, BUS_CONTROL_MONITOR);
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 0/5] staging: gpib: remove unused variables
2025-02-14 19:54 [PATCH v2 0/5] staging: gpib: remove unused variables Gaston Gonzalez
` (4 preceding siblings ...)
2025-02-14 19:54 ` [PATCH v2 5/5] staging: gpib: ines: " Gaston Gonzalez
@ 2025-02-16 15:11 ` Dan Carpenter
5 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2025-02-16 15:11 UTC (permalink / raw)
To: Gaston Gonzalez
Cc: linux-staging, dpenkler, gregkh, arnd, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel
On Fri, Feb 14, 2025 at 04:54:38PM -0300, Gaston Gonzalez wrote:
> Remove some unused variables found compiling with W=1.
>
> v1 -> v2:
>
> Address Kees Bakker review:
This looks good to me now. Thanks Kees for finding the bugs in
v1.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread