* [PATCH 0/5] staging: gpib: remove unused variables
@ 2025-02-07 15:04 Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 15:04 UTC (permalink / raw)
To: linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, kees, skhan,
linux-kernel, gascoar
Remove some unused variables found compiling with make W=1.
Gaston Gonzalez (5):
staging: gpib: cb7210: remove unused variable
staging: gpib: eastwood: remove unused variable
staging: gpib: ni_usb: remove unused variable
staging: gpib: tnt4882: remove unused variable
staging: gpib: ines: remove unused variable
drivers/staging/gpib/cb7210/cb7210.c | 2 --
drivers/staging/gpib/eastwood/fluke_gpib.c | 2 --
drivers/staging/gpib/ines/ines_gpib.c | 2 --
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 --
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 --
5 files changed, 10 deletions(-)
--
2.47.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] staging: gpib: cb7210: remove unused variable
2025-02-07 15:04 [PATCH 0/5] staging: gpib: remove unused variables Gaston Gonzalez
@ 2025-02-07 15:04 ` Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 2/5] staging: gpib: eastwood: " Gaston Gonzalez
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 15:04 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 change 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>
---
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.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] staging: gpib: eastwood: remove unused variable
2025-02-07 15:04 [PATCH 0/5] staging: gpib: remove unused variables Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
@ 2025-02-07 15:04 ` Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 3/5] staging: gpib: ni_usb: " Gaston Gonzalez
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 15:04 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 change 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>
---
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.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] staging: gpib: ni_usb: remove unused variable
2025-02-07 15:04 [PATCH 0/5] staging: gpib: remove unused variables Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 2/5] staging: gpib: eastwood: " Gaston Gonzalez
@ 2025-02-07 15:04 ` Gaston Gonzalez
2025-02-07 19:46 ` Kees Bakker
2025-02-07 15:04 ` [PATCH 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 5/5] staging: gpib: ines: " Gaston Gonzalez
4 siblings, 1 reply; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 15:04 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'
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>
---
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 --
1 file changed, 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..b7f221def217 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,6 @@ 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++];
if (num_data_blocks) {
*actual_bytes_read = (num_data_blocks - 1) * data_block_length + raw_data[i++];
} else {
--
2.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] staging: gpib: tnt4882: remove unused variable
2025-02-07 15:04 [PATCH 0/5] staging: gpib: remove unused variables Gaston Gonzalez
` (2 preceding siblings ...)
2025-02-07 15:04 ` [PATCH 3/5] staging: gpib: ni_usb: " Gaston Gonzalez
@ 2025-02-07 15:04 ` Gaston Gonzalez
2025-02-07 20:18 ` Kees Bakker
2025-02-07 15:04 ` [PATCH 5/5] staging: gpib: ines: " Gaston Gonzalez
4 siblings, 1 reply; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 15:04 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'
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>
---
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index 2e1c3cbebaca..a681bf559b46 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -704,12 +704,10 @@ 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);
/* set / clear SRQ state since it is not cleared by interrupt */
line_status = tnt_readb(priv, BSR);
if (line_status & BCSR_SRQ_BIT)
--
2.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] staging: gpib: ines: remove unused variable
2025-02-07 15:04 [PATCH 0/5] staging: gpib: remove unused variables Gaston Gonzalez
` (3 preceding siblings ...)
2025-02-07 15:04 ` [PATCH 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
@ 2025-02-07 15:04 ` Gaston Gonzalez
4 siblings, 0 replies; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 15:04 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>
---
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.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/5] staging: gpib: ni_usb: remove unused variable
2025-02-07 15:04 ` [PATCH 3/5] staging: gpib: ni_usb: " Gaston Gonzalez
@ 2025-02-07 19:46 ` Kees Bakker
2025-02-07 21:07 ` Gaston Gonzalez
0 siblings, 1 reply; 10+ messages in thread
From: Kees Bakker @ 2025-02-07 19:46 UTC (permalink / raw)
To: Gaston Gonzalez, linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, skhan,
linux-kernel
Op 07-02-2025 om 16:04 schreef Gaston Gonzalez:
> Remove unused variable 'adr1_bits' in function 'parse_board_ibrd_readback'
>
> 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>
> ---
> drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 --
> 1 file changed, 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..b7f221def217 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,6 @@ 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++];
Careful. You're removing the i++ as well.
> if (num_data_blocks) {
> *actual_bytes_read = (num_data_blocks - 1) * data_block_length + raw_data[i++];
> } else {
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/5] staging: gpib: tnt4882: remove unused variable
2025-02-07 15:04 ` [PATCH 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
@ 2025-02-07 20:18 ` Kees Bakker
2025-02-07 21:16 ` Gaston Gonzalez
0 siblings, 1 reply; 10+ messages in thread
From: Kees Bakker @ 2025-02-07 20:18 UTC (permalink / raw)
To: Gaston Gonzalez, linux-staging
Cc: dpenkler, gregkh, arnd, dan.carpenter, ajithpv.linux,
roheetchavan, niharchaithanya, eleanor15x, everestkc, skhan,
linux-kernel
Op 07-02-2025 om 16:04 schreef Gaston Gonzalez:
> Remove unused variable 'retval' in function 'tnt4882_update_status'
>
> 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>
> ---
> drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
> index 2e1c3cbebaca..a681bf559b46 100644
> --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
> +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
> @@ -704,12 +704,10 @@ 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);
You cannot remove a function call just like that. At least, not without
describing that
it is OK to do so.
> /* set / clear SRQ state since it is not cleared by interrupt */
> line_status = tnt_readb(priv, BSR);
> if (line_status & BCSR_SRQ_BIT)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/5] staging: gpib: ni_usb: remove unused variable
2025-02-07 19:46 ` Kees Bakker
@ 2025-02-07 21:07 ` Gaston Gonzalez
0 siblings, 0 replies; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 21:07 UTC (permalink / raw)
To: Kees Bakker
Cc: linux-staging, dpenkler, gregkh, arnd, dan.carpenter,
ajithpv.linux, roheetchavan, niharchaithanya, eleanor15x,
everestkc, skhan, linux-kernel
Hi Kees,
Thank you for the review.
On Fri, Feb 07, 2025 at 08:46:53PM +0100, Kees Bakker wrote:
> Op 07-02-2025 om 16:04 schreef Gaston Gonzalez:
> > Remove unused variable 'adr1_bits' in function 'parse_board_ibrd_readback'
> >
> > 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>
> > ---
> > drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 --
> > 1 file changed, 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..b7f221def217 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,6 @@ 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++];
> Careful. You're removing the i++ as well.
Ok, you are right. I missed that.. I'll redo the patch.
> > if (num_data_blocks) {
> > *actual_bytes_read = (num_data_blocks - 1) * data_block_length + raw_data[i++];
> > } else {
>
regards,
Gaston
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/5] staging: gpib: tnt4882: remove unused variable
2025-02-07 20:18 ` Kees Bakker
@ 2025-02-07 21:16 ` Gaston Gonzalez
0 siblings, 0 replies; 10+ messages in thread
From: Gaston Gonzalez @ 2025-02-07 21:16 UTC (permalink / raw)
To: Kees Bakker
Cc: linux-staging, dpenkler, gregkh, arnd, dan.carpenter,
ajithpv.linux, roheetchavan, niharchaithanya, eleanor15x,
everestkc, skhan, linux-kernel
On Fri, Feb 07, 2025 at 09:18:45PM +0100, Kees Bakker wrote:
> Op 07-02-2025 om 16:04 schreef Gaston Gonzalez:
> > Remove unused variable 'retval' in function 'tnt4882_update_status'
> >
> > 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>
> > ---
> > drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
> > index 2e1c3cbebaca..a681bf559b46 100644
> > --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
> > +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
> > @@ -704,12 +704,10 @@ 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);
> You cannot remove a function call just like that. At least, not without
> describing that
> it is OK to do so.
> > /* set / clear SRQ state since it is not cleared by interrupt */
> > line_status = tnt_readb(priv, BSR);
> > if (line_status & BCSR_SRQ_BIT)
>
You are obviously right on this one too. I'll look into this one more
carefully and I'll send a v2.
Regards,
Gaston
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-02-07 21:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 15:04 [PATCH 0/5] staging: gpib: remove unused variables Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 1/5] staging: gpib: cb7210: remove unused variable Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 2/5] staging: gpib: eastwood: " Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 3/5] staging: gpib: ni_usb: " Gaston Gonzalez
2025-02-07 19:46 ` Kees Bakker
2025-02-07 21:07 ` Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 4/5] staging: gpib: tnt4882: " Gaston Gonzalez
2025-02-07 20:18 ` Kees Bakker
2025-02-07 21:16 ` Gaston Gonzalez
2025-02-07 15:04 ` [PATCH 5/5] staging: gpib: ines: " Gaston Gonzalez
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.