Linux-Serial Archive mirror
 help / color / mirror / Atom feed
From: Parker Newman <parker@finest.io>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Parker Newman" <pnewman@connecttech.com>
Subject: [PATCH v2 3/4] serial: exar: return bool from exar_ee_read_bit()
Date: Fri, 19 Apr 2024 10:17:03 -0400	[thread overview]
Message-ID: <cf67865525b30f58dbc8fbbe13865f73b5377c2f.1713533298.git.pnewman@connecttech.com> (raw)
In-Reply-To: <cover.1713533298.git.pnewman@connecttech.com>

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


  parent reply	other threads:[~2024-04-19 14:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 14:17 [PATCH v2 0/4] serial: exar: fix kbuild warnings and code style Parker Newman
2024-04-19 14:17 ` [PATCH v2 1/4] serial: exar: add missing kernel doc function parameters Parker Newman
2024-04-19 14:17 ` [PATCH v2 2/4] serial: exar: use return dev_err_probe instead of returning error code Parker Newman
2024-04-19 14:17 ` Parker Newman [this message]
2024-04-19 14:17 ` [PATCH v2 4/4] serial: exar: remove ternaries from cti_get_port_type_xr17c15x_xr17v25x() Parker Newman
2024-04-22  6:34   ` Jiri Slaby
2024-05-02 16:18 ` [PATCH v2 0/4] serial: exar: fix kbuild warnings and code style Parker Newman
2024-05-04 16:01   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf67865525b30f58dbc8fbbe13865f73b5377c2f.1713533298.git.pnewman@connecttech.com \
    --to=parker@finest.io \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pnewman@connecttech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).