mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mohammad Mahfooz <mohammadmahfoozpersonal@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "Mohammad Mahfooz" <mohammadmahfoozpersonal@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Johan Hovold" <johan@kernel.org>,
	"Alexander Vorwerk" <alexander.vorwerk@stud.uni-goettingen.de>,
	linux-serial@vger.kernel.org
Subject: [PATCH] serial: jsm: fix style issues
Date: Sun, 19 Feb 2023 00:57:44 -0500	[thread overview]
Message-ID: <20230219055746.15298-1-mohammadmahfoozpersonal@gmail.com> (raw)

Use min_t instead of min to improve type safety.

While at it, replace neo_parse_modem (hard-coded function name) with __func__.

Also fix minor styling issues, like removing redundant return statement in void function.

Signed-off-by: Mohammad Mahfooz <mohammadmahfoozpersonal@gmail.com>
---
 drivers/tty/serial/jsm/jsm_neo.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c
index 0c78f66276cd..d4451fe06d99 100644
--- a/drivers/tty/serial/jsm/jsm_neo.c
+++ b/drivers/tty/serial/jsm/jsm_neo.c
@@ -29,7 +29,7 @@ static u32 jsm_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x8
  */
 static inline void neo_pci_posting_flush(struct jsm_board *bd)
 {
-      readb(bd->re_map_membase + 0x8D);
+     readb(bd->re_map_membase + 0x8D);
 }
 
 static void neo_set_cts_flow_control(struct jsm_channel *ch)
@@ -350,7 +350,7 @@ static void neo_copy_data_from_uart_to_queue(struct jsm_channel *ch)
 		 * IBM pSeries platform.
 		 * 15 bytes max appears to be the magic number.
 		 */
-		n = min((u32) n, (u32) 12);
+		n = min_t(u32, n, 12);
 
 		/*
 		 * Since we are grabbing the linestatus register, which
@@ -433,7 +433,7 @@ static void neo_copy_data_from_uart_to_queue(struct jsm_channel *ch)
 		/*
 		 * If our queue is full, we have no choice but to drop some data.
 		 * The assumption is that HWFLOW or SWFLOW should have stopped
-		 * things way way before we got to this point.
+		 * things way before we got to this point.
 		 *
 		 * I decided that I wanted to ditch the oldest data first,
 		 * I hope thats okay with everyone? Yes? Good.
@@ -560,8 +560,8 @@ static void neo_parse_modem(struct jsm_channel *ch, u8 signals)
 	u8 msignals = signals;
 
 	jsm_dbg(MSIGS, &ch->ch_bd->pci_dev,
-		"neo_parse_modem: port: %d msignals: %x\n",
-		ch->ch_portnum, msignals);
+	"%s: port: %d msignals: %x\n",
+	__func__, ch->ch_portnum, msignals);
 
 	/* Scrub off lower bits. They signify delta's, which I don't care about */
 	/* Keep DDCD and DDSR though */
@@ -592,7 +592,7 @@ static void neo_parse_modem(struct jsm_channel *ch, u8 signals)
 		ch->ch_mistat &= ~UART_MSR_CTS;
 
 	jsm_dbg(MSIGS, &ch->ch_bd->pci_dev,
-		"Port: %d DTR: %d RTS: %d CTS: %d DSR: %d " "RI: %d CD: %d\n",
+		"Port: %d DTR: %d RTS: %d CTS: %d DSR: %d RI: %d CD: %d\n",
 		ch->ch_portnum,
 		!!((ch->ch_mistat | ch->ch_mostat) & UART_MCR_DTR),
 		!!((ch->ch_mistat | ch->ch_mostat) & UART_MCR_RTS),
@@ -770,9 +770,9 @@ static void neo_parse_isr(struct jsm_board *brd, u32 port)
 			spin_lock_irqsave(&ch->ch_lock, lock_flags);
 			if (cause == UART_17158_XON_DETECT) {
 				/* Is output stopped right now, if so, resume it */
-				if (brd->channels[port]->ch_flags & CH_STOP) {
+				if (brd->channels[port]->ch_flags & CH_STOP)
 					ch->ch_flags &= ~(CH_STOP);
-				}
+
 				jsm_dbg(INTR, &ch->ch_bd->pci_dev,
 					"Port %d. XON detected in incoming data\n",
 					port);
@@ -1067,7 +1067,6 @@ static void neo_param(struct jsm_channel *ch)
 
 	/* Get current status of the modem signals now */
 	neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr));
-	return;
 }
 
 /*
@@ -1147,7 +1146,7 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
 		case UART_17158_RXRDY_TIMEOUT:
 			/*
 			 * RXRDY Time-out is cleared by reading data in the
-			* RX FIFO until it falls below the trigger level.
+			 * RX FIFO until it falls below the trigger level.
 			 */
 
 			/* Verify the port is in range. */
-- 
2.34.1


             reply	other threads:[~2023-02-19  5:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19  5:57 Mohammad Mahfooz [this message]
2023-02-19  7:25 ` 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=20230219055746.15298-1-mohammadmahfoozpersonal@gmail.com \
    --to=mohammadmahfoozpersonal@gmail.com \
    --cc=alexander.vorwerk@stud.uni-goettingen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®