Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1529637

[PATCH 5/8] irda: w83977af_ir: Use the common brace style

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject [PATCH 5/8] irda: w83977af_ir: Use the common brace style
Date 2016-11-24 20:20 +0100
Message-ID <sH7IS-6We-19@gated-at.bofh.it> (permalink)
References <sH7IS-6We-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 ac481303e3ab..5d776fb716f4 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] irda: w83977af_ir: Neatening Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  [PATCH 5/8] irda: w83977af_ir: Use the common brace style Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  [PATCH 3/8] irda: w83977af_ir: Remove unnecessary blank lines Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
    Re: [PATCH 3/8] irda: w83977af_ir: Remove unnecessary blank lines Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-11-25 11:40 +0100
  [PATCH 2/8] irda: w83977af_ir: More whitespace neatening Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  [PATCH 8/8] irda: w83977af_ir: Fix misindented block Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  [PATCH 1/8] irda: w83977af_ir: whitespace neatening Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  [PATCH 6/8] irda: w83977af_ir: Parenthesis alignment Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  [PATCH 4/8] irda: w83977af_ir: Neaten pointer comparisons Joe Perches <joe@perches.com> - 2016-11-24 20:20 +0100
  Re: [PATCH 0/8] irda: w83977af_ir: Neatening Joe Perches <joe@perches.com> - 2016-12-05 19:20 +0100
    Re: [PATCH 0/8] irda: w83977af_ir: Neatening David Miller <davem@davemloft.net> - 2016-12-05 19:40 +0100

csiph-web