[PATCH 4/5] staging: gpib: tnt4882: remove unused variable

Gaston Gonzalez posted 5 patches 1 year ago
There is a newer version of this series
[PATCH 4/5] staging: gpib: tnt4882: remove unused variable
Posted by Gaston Gonzalez 1 year ago
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

Re: [PATCH 4/5] staging: gpib: tnt4882: remove unused variable
Posted by Kees Bakker 1 year ago
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)

Re: [PATCH 4/5] staging: gpib: tnt4882: remove unused variable
Posted by Gaston Gonzalez 1 year ago
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