mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tty: synclink_gt: remove redundant initialization of variable count
@ 2021-04-20 10:57 Colin King
  2021-04-20 11:02 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-04-20 10:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: kernel-janitors, linux-kernel

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

The variable count is being initialized with 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>
---
 drivers/tty/synclink_gt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index 994618618466..5523cf7bd1c2 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -4958,7 +4958,7 @@ static int loopback_test(struct slgt_info *info)
 #define TESTFRAMESIZE 20
 
 	unsigned long timeout;
-	u16 count = TESTFRAMESIZE;
+	u16 count;
 	unsigned char buf[TESTFRAMESIZE];
 	int rc = -ENODEV;
 	unsigned long flags;
-- 
2.30.2


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

* Re: [PATCH] tty: synclink_gt: remove redundant initialization of variable count
  2021-04-20 10:57 [PATCH] tty: synclink_gt: remove redundant initialization of variable count Colin King
@ 2021-04-20 11:02 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2021-04-20 11:02 UTC (permalink / raw)
  To: Colin King, Greg Kroah-Hartman; +Cc: kernel-janitors, linux-kernel

On 20. 04. 21, 12:57, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable count is being initialized with 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: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/synclink_gt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
> index 994618618466..5523cf7bd1c2 100644
> --- a/drivers/tty/synclink_gt.c
> +++ b/drivers/tty/synclink_gt.c
> @@ -4958,7 +4958,7 @@ static int loopback_test(struct slgt_info *info)
>   #define TESTFRAMESIZE 20
>   
>   	unsigned long timeout;
> -	u16 count = TESTFRAMESIZE;
> +	u16 count;
>   	unsigned char buf[TESTFRAMESIZE];
>   	int rc = -ENODEV;
>   	unsigned long flags;
> 


-- 
js

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

end of thread, other threads:[~2021-04-20 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 10:57 [PATCH] tty: synclink_gt: remove redundant initialization of variable count Colin King
2021-04-20 11:02 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome