linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mxser: remove redundant assignment to hwid
@ 2022-07-30 13:09 Colin Ian King
  2022-08-04  5:43 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-07-30 13:09 UTC (permalink / raw)
  To: Jiri Slaby, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

The variable hwid is assigned a value but it is never read. The
assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/tty/mxser.c:401:7: warning: Although the value stored to 'hwid'
is used in the enclosing expression, the value is never actually read
from 'hwid' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/tty/mxser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 70b982b2c6b2..600c71e5eebc 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -398,7 +398,7 @@ static enum mxser_must_hwid mxser_must_get_hwid(unsigned long io)
 	oldmcr = inb(io + UART_MCR);
 	outb(0, io + UART_MCR);
 	mxser_set_must_xon1_value(io, 0x11);
-	if ((hwid = inb(io + UART_MCR)) != 0) {
+	if (inb(io + UART_MCR) != 0) {
 		outb(oldmcr, io + UART_MCR);
 		return MOXA_OTHER_UART;
 	}
-- 
2.35.3


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

* Re: [PATCH] mxser: remove redundant assignment to hwid
  2022-07-30 13:09 [PATCH] mxser: remove redundant assignment to hwid Colin Ian King
@ 2022-08-04  5:43 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2022-08-04  5:43 UTC (permalink / raw)
  To: Colin Ian King, Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

On 30. 07. 22, 15:09, Colin Ian King wrote:
> The variable hwid is assigned a value but it is never read. The
> assignment is redundant and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/tty/mxser.c:401:7: warning: Although the value stored to 'hwid'
> is used in the enclosing expression, the value is never actually read
> from 'hwid' [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/mxser.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
> index 70b982b2c6b2..600c71e5eebc 100644
> --- a/drivers/tty/mxser.c
> +++ b/drivers/tty/mxser.c
> @@ -398,7 +398,7 @@ static enum mxser_must_hwid mxser_must_get_hwid(unsigned long io)
>   	oldmcr = inb(io + UART_MCR);
>   	outb(0, io + UART_MCR);
>   	mxser_set_must_xon1_value(io, 0x11);
> -	if ((hwid = inb(io + UART_MCR)) != 0) {
> +	if (inb(io + UART_MCR) != 0) {

Yes, hwid is read later, this was a dummy assignment.

>   		outb(oldmcr, io + UART_MCR);
>   		return MOXA_OTHER_UART;
>   	}

thanks,
-- 
js
suse labs

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

end of thread, other threads:[~2022-08-04  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30 13:09 [PATCH] mxser: remove redundant assignment to hwid Colin Ian King
2022-08-04  5:43 ` Jiri Slaby

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).