Thread (8 messages) flat view 8 messages, 3 authors, 2021-02-07
STALE2018d

[PATCH 3/3] drivers/net/ethernet/amd: Break apart one-lined expressions

From: Amy Parker <hidden>
Date: 2021-02-06 03:12:04
Also in: lkml
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Some expressions using C keywords - especially if expressions - are
crammed onto one line. The kernel style guide indicates not to do
this, as it harms readability. This patch splits these one-lined
statements into two lines.

Signed-off-by: Amy Parker <redacted>
---
 drivers/net/ethernet/amd/atarilance.c | 15 ++++++++++-----
 drivers/net/ethernet/amd/sun3lance.c  | 27 ++++++++++++++++++---------
 2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c
index 9ec44cf4ba9c..3e264a52307e 100644
--- a/drivers/net/ethernet/amd/atarilance.c
+++ b/drivers/net/ethernet/amd/atarilance.c
@@ -481,27 +481,32 @@ static unsigned long __init lance_probe1( struct net_device *dev,
 
 	/* Test whether memory readable and writable */
 	PROBE_PRINT(( "lance_probe1: testing memory to be accessible\n" ));
-	if (!addr_accessible( memaddr, 1, 1 )) goto probe_fail;
+	if (!addr_accessible(memaddr, 1, 1))
+		goto probe_fail;
 
 	/* Written values should come back... */
 	PROBE_PRINT(( "lance_probe1: testing memory to be writable (1)\n" ));
 	save1 = *memaddr;
 	*memaddr = 0x0001;
-	if (*memaddr != 0x0001) goto probe_fail;
+	if (*memaddr != 0x0001)
+		goto probe_fail;
 	PROBE_PRINT(( "lance_probe1: testing memory to be writable (2)\n" ));
 	*memaddr = 0x0000;
-	if (*memaddr != 0x0000) goto probe_fail;
+	if (*memaddr != 0x0000)
+		goto probe_fail;
 	*memaddr = save1;
 
 	/* First port should be readable and writable */
 	PROBE_PRINT(( "lance_probe1: testing ioport to be accessible\n" ));
-	if (!addr_accessible( ioaddr, 1, 1 )) goto probe_fail;
+	if (!addr_accessible(ioaddr, 1, 1))
+		goto probe_fail;
 
 	/* and written values should be readable */
 	PROBE_PRINT(( "lance_probe1: testing ioport to be writeable\n" ));
 	save2 = ioaddr[1];
 	ioaddr[1] = 0x0001;
-	if (ioaddr[1] != 0x0001) goto probe_fail;
+	if (ioaddr[1] != 0x0001)
+		goto probe_fail;
 
 	/* The CSR0_INIT bit should not be readable */
 	PROBE_PRINT(( "lance_probe1: testing CSR0 register function (1)\n" ));
diff --git a/drivers/net/ethernet/amd/sun3lance.c b/drivers/net/ethernet/amd/sun3lance.c
index c7af742f63ad..88fce468e848 100644
--- a/drivers/net/ethernet/amd/sun3lance.c
+++ b/drivers/net/ethernet/amd/sun3lance.c
@@ -699,9 +699,12 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id)
 			if (head->flag & TMD1_ERR) {
 				int status = head->misc;
 				dev->stats.tx_errors++;
-				if (status & TMD3_RTRY) dev->stats.tx_aborted_errors++;
-				if (status & TMD3_LCAR) dev->stats.tx_carrier_errors++;
-				if (status & TMD3_LCOL) dev->stats.tx_window_errors++;
+				if (status & TMD3_RTRY)
+					dev->stats.tx_aborted_errors++;
+				if (status & TMD3_LCAR)
+					dev->stats.tx_carrier_errors++;
+				if (status & TMD3_LCOL)
+					dev->stats.tx_window_errors++;
 				if (status & (TMD3_UFLO | TMD3_BUFF)) {
 					dev->stats.tx_fifo_errors++;
 					printk("%s: Tx FIFO error\n",
@@ -738,8 +741,10 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id)
 		lance_rx( dev );
 
 	/* Log misc errors. */
-	if (csr0 & CSR0_BABL) dev->stats.tx_errors++; /* Tx babble. */
-	if (csr0 & CSR0_MISS) dev->stats.rx_errors++; /* Missed a Rx frame. */
+	if (csr0 & CSR0_BABL)
+		dev->stats.tx_errors++; /* Tx babble. */
+	if (csr0 & CSR0_MISS)
+		dev->stats.rx_errors++; /* Missed a Rx frame. */
 	if (csr0 & CSR0_MERR) {
 		DPRINTK( 1, ( "%s: Bus master arbitration failure (?!?), "
 			      "status %04x.\n", dev->name, csr0 ));
@@ -785,10 +790,14 @@ static int lance_rx( struct net_device *dev )
 			   buffers, with only the last correctly noting the error. */
 			if (status & RMD1_ENP)	/* Only count a general error at the */
 				dev->stats.rx_errors++; /* end of a packet.*/
-			if (status & RMD1_FRAM) dev->stats.rx_frame_errors++;
-			if (status & RMD1_OFLO) dev->stats.rx_over_errors++;
-			if (status & RMD1_CRC) dev->stats.rx_crc_errors++;
-			if (status & RMD1_BUFF) dev->stats.rx_fifo_errors++;
+			if (status & RMD1_FRAM)
+				dev->stats.rx_frame_errors++;
+			if (status & RMD1_OFLO)
+				dev->stats.rx_over_errors++;
+			if (status & RMD1_CRC)
+				dev->stats.rx_crc_errors++;
+			if (status & RMD1_BUFF)
+				dev->stats.rx_fifo_errors++;
 			head->flag &= (RMD1_ENP|RMD1_STP);
 		} else {
 			/* Malloc up new buffer, compatible with net-3. */
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help