mxser: remove redundant assignment to hwid
Subsystems (4)
PATCH 1/1 mxser: remove redundant assignment to hwid
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]
--- drivers/tty/mxser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/mxser.c +1 -1
@@ -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 ; }
Signature · 1 line
2.35.3
Quoted 9 lines · Colin Ian King
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 <[email protected]>
Quoted 9 lines
--- drivers/tty/mxser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/mxser.c +0
-0
drivers/tty/mxser.c static enum mxser_must_hwid mxser_must_get_hwid(unsigned long io) · line 401
Quoted 5 lines
drivers/tty/mxser.c +1
-1@@ -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.
drivers/tty/mxser.c static enum mxser_must_hwid mxser_must_get_hwid(unsigned long io) · line 404
Quoted 3 lines
drivers/tty/mxser.c +0
-0outb (oldmcr, io +UART_MCR );return MOXA_OTHER_UART ; }
thanks,
Signature · 2 lines
js suse labs