diff mbox series

[v2,3/4] serial: exar: return bool from exar_ee_read_bit()

Message ID cf67865525b30f58dbc8fbbe13865f73b5377c2f.1713533298.git.pnewman@connecttech.com
State New
Headers show
Series serial: exar: fix kbuild warnings and code style | expand

Commit Message

Parker Newman April 19, 2024, 2:17 p.m. UTC
From: Parker Newman <pnewman@connecttech.com>

Change exar_ee_read_bit() to return a bool instead of u8. Removed need
for ternary or if/else for return value.

Signed-off-by: Parker Newman <pnewman@connecttech.com>
---
Changes in v2:
- Change exar_ee_read_bit() to return a bool

 drivers/tty/serial/8250/8250_exar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.43.2
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index 01748ddbf729..8665d3b7b673 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -300,7 +300,7 @@  static inline void exar_ee_write_bit(struct exar8250 *priv, int bit)
 	udelay(2);
 }

-static inline u8 exar_ee_read_bit(struct exar8250 *priv)
+static inline bool exar_ee_read_bit(struct exar8250 *priv)
 {
 	u8 regb;
 	u8 value = UART_EXAR_REGB_EECS;
@@ -317,7 +317,7 @@  static inline u8 exar_ee_read_bit(struct exar8250 *priv)

 	regb = exar_read_reg(priv, UART_EXAR_REGB);

-	return (regb & UART_EXAR_REGB_EEDO ? 1 : 0);
+	return regb & UART_EXAR_REGB_EEDO;
 }

 /**