From: Amy Parker <enbyamy@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, akpm@linux-foundation.org,
rppt@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Amy Parker <enbyamy@gmail.com>
Subject: [PATCH 3/3] drivers/net/ethernet/amd: Break apart one-lined expressions
Date: Fri, 5 Feb 2021 16:01:46 -0800 [thread overview]
Message-ID: <20210206000146.616465-4-enbyamy@gmail.com> (raw)
In-Reply-To: <20210206000146.616465-1-enbyamy@gmail.com>
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 <enbyamy@gmail.com>
---
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
next prev parent reply other threads:[~2021-02-06 2:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 0:01 [PATCH 0/3] drivers/net/ethernet/amd: Follow style guide Amy Parker
2021-02-06 0:01 ` [PATCH 1/3] drivers/net/ethernet/amd: Correct spacing around C keywords Amy Parker
2021-02-06 0:01 ` [PATCH 2/3] drivers/net/ethernet/amd: Fix bracket matching and line levels Amy Parker
2021-02-06 0:01 ` Amy Parker [this message]
2021-02-06 3:16 ` [PATCH 0/3] drivers/net/ethernet/amd: Follow style guide Randy Dunlap
2021-02-06 4:28 ` Amy Parker
2021-02-06 20:07 ` Jakub Kicinski
2021-02-07 20:48 ` Amy Parker
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=20210206000146.616465-4-enbyamy@gmail.com \
--to=enbyamy@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rppt@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;
as well as URLs for NNTP newsgroup(s).