[PATCH v2 13/19] tty: serial: samsung: don't compare with zero an if (bitwise expression)
Tudor Ambarus
tudor.ambarus at linaro.org
Fri Jan 19 02:45:20 PST 2024
The bitwise AND with the fifo mask is used to check if the fifo is empty
or not, it doesn't care about the length, thus the comparison with zero
is implicit. Rely on the implicit comparison instead.
Reviewed-by: Sam Protsenko <semen.protsenko at linaro.org>
Signed-off-by: Tudor Ambarus <tudor.ambarus at linaro.org>
---
drivers/tty/serial/samsung_tty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index f8a8b459a86b..333ffa3a76a3 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -988,7 +988,7 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port)
u32 ufcon = rd_regl(port, S3C2410_UFCON);
if (ufcon & S3C2410_UFCON_FIFOMODE) {
- if ((ufstat & info->tx_fifomask) != 0 ||
+ if ((ufstat & info->tx_fifomask) ||
(ufstat & info->tx_fifofull))
return 0;
return TIOCSER_TEMT;
--
2.43.0.429.g432eaa2c6b-goog
More information about the linux-arm-kernel
mailing list