lkml.org 
[lkml]   [2024]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 3/4] serial: exar: return bool from exar_ee_read_bit()
Date
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(-)

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

\
 
 \ /
  Last update: 2024-04-19 16:17    [W:0.090 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site