linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] floppy: remove redundant assignment to variable st
@ 2021-04-15 13:00 Colin King
  2021-04-15 13:21 ` Willy Tarreau
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Colin King @ 2021-04-15 13:00 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H . Peter Anvin, Denis Efremov, Willy Tarreau
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable st is being assigned a value that is never read and
it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 arch/x86/include/asm/floppy.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index d43717b423cb..6ec3fc969ad5 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -74,7 +74,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
 		int lcount;
 		char *lptr;
 
-		st = 1;
 		for (lcount = virtual_dma_count, lptr = virtual_dma_addr;
 		     lcount; lcount--, lptr++) {
 			st = inb(virtual_dma_port + FD_STATUS);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] floppy: remove redundant assignment to variable st
  2021-04-15 13:00 [PATCH] floppy: remove redundant assignment to variable st Colin King
@ 2021-04-15 13:21 ` Willy Tarreau
  2021-04-16  7:34 ` Denis Efremov
  2021-04-16 12:29 ` Denis Efremov
  2 siblings, 0 replies; 5+ messages in thread
From: Willy Tarreau @ 2021-04-15 13:21 UTC (permalink / raw)
  To: Colin King
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H . Peter Anvin, Denis Efremov, kernel-janitors, linux-kernel

On Thu, Apr 15, 2021 at 02:00:20PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable st is being assigned a value that is never read and
> it is being updated later with a new value. The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Indeed you're right.

Acked-by: Willy Tarreau <w@1wt.eu>

Willy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] floppy: remove redundant assignment to variable st
  2021-04-15 13:00 [PATCH] floppy: remove redundant assignment to variable st Colin King
  2021-04-15 13:21 ` Willy Tarreau
@ 2021-04-16  7:34 ` Denis Efremov
  2021-04-16 12:29 ` Denis Efremov
  2 siblings, 0 replies; 5+ messages in thread
From: Denis Efremov @ 2021-04-16  7:34 UTC (permalink / raw)
  To: Colin King, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H . Peter Anvin, Willy Tarreau
  Cc: kernel-janitors, linux-kernel

Hi,

On 4/15/21 4:00 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable st is being assigned a value that is never read and
> it is being updated later with a new value. The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks!

https://github.com/evdenis/linux-floppy/commit/aeec7983d49a5f972df47c742ff8373df15b0d28

> ---
>  arch/x86/include/asm/floppy.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> index d43717b423cb..6ec3fc969ad5 100644
> --- a/arch/x86/include/asm/floppy.h
> +++ b/arch/x86/include/asm/floppy.h
> @@ -74,7 +74,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
>  		int lcount;
>  		char *lptr;
>  
> -		st = 1;
>  		for (lcount = virtual_dma_count, lptr = virtual_dma_addr;
>  		     lcount; lcount--, lptr++) {
>  			st = inb(virtual_dma_port + FD_STATUS);
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] floppy: remove redundant assignment to variable st
  2021-04-15 13:00 [PATCH] floppy: remove redundant assignment to variable st Colin King
  2021-04-15 13:21 ` Willy Tarreau
  2021-04-16  7:34 ` Denis Efremov
@ 2021-04-16 12:29 ` Denis Efremov
  2021-04-16 12:30   ` Jens Axboe
  2 siblings, 1 reply; 5+ messages in thread
From: Denis Efremov @ 2021-04-16 12:29 UTC (permalink / raw)
  To: Jens Axboe
  Cc: kernel-janitors, linux-kernel, Colin King, Willy Tarreau,
	linux-block, Linux Kernel Mailing List

Jens, could you please take this one? I thought to send it to you with other
cleanup patches in a merge request, but you already applied rest of the
patches. If you prefer to take it as merge request, it's ok I'll send it
based on your branch for-5.13/drivers.

On 4/15/21 4:00 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable st is being assigned a value that is never read and
> it is being updated later with a new value. The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Denis Efremov <efremov@linux.com>

Thanks,
Denis

> ---
>  arch/x86/include/asm/floppy.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
> index d43717b423cb..6ec3fc969ad5 100644
> --- a/arch/x86/include/asm/floppy.h
> +++ b/arch/x86/include/asm/floppy.h
> @@ -74,7 +74,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
>  		int lcount;
>  		char *lptr;
>  
> -		st = 1;
>  		for (lcount = virtual_dma_count, lptr = virtual_dma_addr;
>  		     lcount; lcount--, lptr++) {
>  			st = inb(virtual_dma_port + FD_STATUS);
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] floppy: remove redundant assignment to variable st
  2021-04-16 12:29 ` Denis Efremov
@ 2021-04-16 12:30   ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2021-04-16 12:30 UTC (permalink / raw)
  To: Denis Efremov
  Cc: kernel-janitors, linux-kernel, Colin King, Willy Tarreau, linux-block

On 4/16/21 6:29 AM, Denis Efremov wrote:
> Jens, could you please take this one? I thought to send it to you with other
> cleanup patches in a merge request, but you already applied rest of the
> patches. If you prefer to take it as merge request, it's ok I'll send it
> based on your branch for-5.13/drivers.

I have applied it, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-16 12:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 13:00 [PATCH] floppy: remove redundant assignment to variable st Colin King
2021-04-15 13:21 ` Willy Tarreau
2021-04-16  7:34 ` Denis Efremov
2021-04-16 12:29 ` Denis Efremov
2021-04-16 12:30   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).