From: Joe Perches <joe@perches.com>
To: Samuel Ortiz <samuel@sortiz.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 5/7] irda: w83977af_ir: Use the common brace style
Date: Tue, 6 Dec 2016 10:16:04 -0800 [thread overview]
Message-ID: <fffcc558da965c75c2e293348de1aa2bc0725c05.1481047792.git.joe@perches.com> (raw)
In-Reply-To: <cover.1481047792.git.joe@perches.com>
Add braces where appropriate and remove an unnecessary else.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/irda/w83977af_ir.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index 92f1525b0570..5d5ec8938e2b 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -462,8 +462,9 @@ static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed)
if (speed > PIO_MAX_SPEED) {
outb(ICR_EFSFI, iobase + ICR);
w83977af_dma_receive(self);
- } else
+ } else {
outb(ICR_ERBRI, iobase + ICR);
+ }
/* Restore SSR */
outb(set, iobase + SSR);
@@ -502,8 +503,8 @@ static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb,
w83977af_change_speed(self, speed);
dev_kfree_skb(skb);
return NETDEV_TX_OK;
- } else
- self->new_speed = speed;
+ }
+ self->new_speed = speed;
}
/* Save current set */
@@ -649,8 +650,9 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self)
/* Clear bit, by writing 1 to it */
outb(AUDR_UNDR, iobase + AUDR);
- } else
+ } else {
self->netdev->stats.tx_packets++;
+ }
if (self->new_speed) {
w83977af_change_speed(self, self->new_speed);
@@ -813,9 +815,8 @@ static int w83977af_dma_receive_complete(struct w83977af_ir *self)
} else {
/* Check if we have transferred all data to memory */
switch_bank(iobase, SET0);
- if (inb(iobase + USR) & USR_RDR) {
+ if (inb(iobase + USR) & USR_RDR)
udelay(80); /* Should be enough!? */
- }
skb = dev_alloc_skb(len + 1);
if (!skb) {
@@ -969,7 +970,6 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr)
/* End of frame detected in FIFO */
if (isr & (ISR_FEND_I | ISR_FSF_I)) {
if (w83977af_dma_receive_complete(self)) {
-
/* Wait for next status FIFO interrupt */
new_icr |= ICR_EFSFI;
} else {
@@ -1094,8 +1094,9 @@ static int w83977af_is_receiving(struct w83977af_ir *self)
status = TRUE;
}
outb(set, iobase + SSR);
- } else
+ } else {
status = (self->rx_buff.state != OUTSIDE_FRAME);
+ }
return status;
}
@@ -1141,8 +1142,9 @@ static int w83977af_net_open(struct net_device *dev)
if (self->io.speed > 115200) {
outb(ICR_EFSFI, iobase + ICR);
w83977af_dma_receive(self);
- } else
+ } else {
outb(ICR_ERBRI, iobase + ICR);
+ }
/* Restore bank register */
outb(set, iobase + SSR);
--
2.10.0.rc2.1.g053435c
next prev parent reply other threads:[~2016-12-06 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 18:15 [PATCH v3 0/7] irda: w83977af_ir: Neatening Joe Perches
2016-12-06 18:16 ` [PATCH v3 1/7] irda: w83977af_ir: Whitespace neatening Joe Perches
2016-12-06 18:16 ` [PATCH v3 2/7] irda: w83977af_ir: More whitespace neatening Joe Perches
2016-12-06 18:16 ` [PATCH v3 3/7] irda: w83977af_ir: Remove and add blank lines Joe Perches
2016-12-06 18:16 ` [PATCH v3 4/7] irda: w83977af_ir: Neaten pointer comparisons Joe Perches
2016-12-06 18:16 ` Joe Perches [this message]
2016-12-06 18:16 ` [PATCH v3 6/7] irda: w83977af_ir: Parenthesis alignment Joe Perches
2016-12-06 18:16 ` [PATCH v3 7/7] irda: w83977af_ir: Neaten logging Joe Perches
2016-12-07 2:47 ` [PATCH v3 0/7] irda: w83977af_ir: Neatening David Miller
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=fffcc558da965c75c2e293348de1aa2bc0725c05.1481047792.git.joe@perches.com \
--to=joe@perches.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=samuel@sortiz.org \
--cc=sergei.shtylyov@cogentembedded.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 NNTP newsgroup(s).