[PATCH] serial: sc16is7xx: drop redundant conversion to bool

Xichao Zhao posted 1 patch 1 month, 1 week ago
drivers/tty/serial/sc16is7xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] serial: sc16is7xx: drop redundant conversion to bool
Posted by Xichao Zhao 1 month, 1 week ago
The result of integer comparison already evaluates to bool. No need for
explicit conversion.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/tty/serial/sc16is7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 5ea8aadb6e69..1c115d9e3b3f 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -626,7 +626,7 @@ static void sc16is7xx_handle_rx(struct uart_port *port, unsigned int rxlen,
 {
 	struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
 	unsigned int lsr = 0, bytes_read, i;
-	bool read_lsr = (iir == SC16IS7XX_IIR_RLSE_SRC) ? true : false;
+	bool read_lsr = (iir == SC16IS7XX_IIR_RLSE_SRC);
 	u8 ch, flag;
 
 	if (unlikely(rxlen >= sizeof(one->buf))) {
-- 
2.34.1
Re: [PATCH] serial: sc16is7xx: drop redundant conversion to bool
Posted by Jiri Slaby 3 weeks, 4 days ago
On 27. 08. 25, 4:45, Xichao Zhao wrote:
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>

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

-- 
js
suse labs