All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: kgdb_nmi: remove redundant initialization of variable c
@ 2021-05-13 23:02 Colin King
  2021-05-14  6:51 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-05-13 23:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-serial
  Cc: kernel-janitors, linux-kernel

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

The variable c is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/tty/serial/kgdb_nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/kgdb_nmi.c b/drivers/tty/serial/kgdb_nmi.c
index db059b66438e..7e07ee915f3f 100644
--- a/drivers/tty/serial/kgdb_nmi.c
+++ b/drivers/tty/serial/kgdb_nmi.c
@@ -115,7 +115,7 @@ static void kgdb_tty_recv(int ch)
 static int kgdb_nmi_poll_one_knock(void)
 {
 	static int n;
-	int c = -1;
+	int c;
 	const char *magic = kgdb_nmi_magic;
 	size_t m = strlen(magic);
 	bool printch = false;
-- 
2.30.2


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

* Re: [PATCH] serial: kgdb_nmi: remove redundant initialization of variable c
  2021-05-13 23:02 [PATCH] serial: kgdb_nmi: remove redundant initialization of variable c Colin King
@ 2021-05-14  6:51 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2021-05-14  6:51 UTC (permalink / raw)
  To: Colin King, Greg Kroah-Hartman, linux-serial
  Cc: kernel-janitors, linux-kernel

On 14. 05. 21, 1:02, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable c is being initialized with a value that is never
> read, it is being updated later on. The assignment 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/serial/kgdb_nmi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/kgdb_nmi.c b/drivers/tty/serial/kgdb_nmi.c
> index db059b66438e..7e07ee915f3f 100644
> --- a/drivers/tty/serial/kgdb_nmi.c
> +++ b/drivers/tty/serial/kgdb_nmi.c
> @@ -115,7 +115,7 @@ static void kgdb_tty_recv(int ch)
>   static int kgdb_nmi_poll_one_knock(void)
>   {
>   	static int n;
> -	int c = -1;
> +	int c;
>   	const char *magic = kgdb_nmi_magic;
>   	size_t m = strlen(magic);
>   	bool printch = false;
> 


-- 
js
suse labs

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

end of thread, other threads:[~2021-05-14  6:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 23:02 [PATCH] serial: kgdb_nmi: remove redundant initialization of variable c Colin King
2021-05-14  6:51 ` Jiri Slaby

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.