2024-04-19 14:18:01

by Parker Newman

[permalink] [raw]
Subject: [PATCH v2 3/4] serial: exar: return bool from exar_ee_read_bit()

From: Parker Newman <[email protected]>

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 <[email protected]>
---
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(-)

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;
}

/**
--
2.43.2