mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
To: <linux-kernel@vger.kernel.org>, <linux-parport@lists.infradead.org>
Cc: <sudipm.mukherjee@gmail.com>, <sudip.mukherjee@codethink.co.uk>,
	<akpm@linux-foundation.org>,
	Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
Subject: [PATCH 5/5] parport: remove unnecessary braces
Date: Mon, 17 Jul 2017 17:40:18 +0100	[thread overview]
Message-ID: <20170717164018.17494-1-palminha@synopsys.com> (raw)
In-Reply-To: <20170717163702.17427-1-palminha@synopsys.com>

based on checkpatch, remove braces not necessary for statements.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
---
 drivers/parport/ieee1284.c       | 40 ++++++++++++++++++++--------------------
 drivers/parport/ieee1284_ops.c   |  9 +++------
 drivers/parport/parport_gsc.c    |  7 +++----
 drivers/parport/parport_pc.c     |  3 +--
 drivers/parport/parport_sunbpp.c | 20 ++++++++------------
 drivers/parport/procfs.c         |  6 ++----
 6 files changed, 37 insertions(+), 48 deletions(-)

diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c
index 27673b838e74..51b2d9f2c142 100644
--- a/drivers/parport/ieee1284.c
+++ b/drivers/parport/ieee1284.c
@@ -631,29 +631,29 @@ ssize_t parport_write(struct parport *port, const void *buffer, size_t len)
 
 	case IEEE1284_MODE_EPP:
 		DPRINTK(KERN_DEBUG "%s: Using EPP mode\n", port->name);
-		if (addr) {
+		if (addr)
 			fn = port->ops->epp_write_addr;
-		} else {
+		else
 			fn = port->ops->epp_write_data;
-		}
+
 		break;
 	case IEEE1284_MODE_EPPSWE:
 		DPRINTK(KERN_DEBUG "%s: Using software-emulated EPP mode\n",
 			port->name);
-		if (addr) {
+		if (addr)
 			fn = parport_ieee1284_epp_write_addr;
-		} else {
+		else
 			fn = parport_ieee1284_epp_write_data;
-		}
+
 		break;
 	case IEEE1284_MODE_ECP:
 	case IEEE1284_MODE_ECPRLE:
 		DPRINTK(KERN_DEBUG "%s: Using ECP mode\n", port->name);
-		if (addr) {
+		if (addr)
 			fn = port->ops->ecp_write_addr;
-		} else {
+		else
 			fn = port->ops->ecp_write_data;
-		}
+
 		break;
 
 	case IEEE1284_MODE_ECPSWE:
@@ -661,11 +661,11 @@ ssize_t parport_write(struct parport *port, const void *buffer, size_t len)
 			 port->name);
 		/* The caller has specified that it must be emulated,
 		 * even if we have ECP hardware! */
-		if (addr) {
+		if (addr)
 			fn = parport_ieee1284_ecp_write_addr;
-		} else {
+		else
 			fn = parport_ieee1284_ecp_write_data;
-		}
+
 		break;
 
 	default:
@@ -726,9 +726,9 @@ ssize_t parport_read(struct parport *port, void *buffer, size_t len)
 			fn = port->ops->byte_read_data;
 			break;
 		}
-		if (parport_negotiate(port, IEEE1284_MODE_NIBBLE)) {
+		if (parport_negotiate(port, IEEE1284_MODE_NIBBLE))
 			return -EIO;
-		}
+
 		/* fall through to NIBBLE */
 	case IEEE1284_MODE_NIBBLE:
 		DPRINTK(KERN_DEBUG "%s: Using nibble mode\n", port->name);
@@ -742,20 +742,20 @@ ssize_t parport_read(struct parport *port, void *buffer, size_t len)
 
 	case IEEE1284_MODE_EPP:
 		DPRINTK(KERN_DEBUG "%s: Using EPP mode\n", port->name);
-		if (addr) {
+		if (addr)
 			fn = port->ops->epp_read_addr;
-		} else {
+		else
 			fn = port->ops->epp_read_data;
-		}
+
 		break;
 	case IEEE1284_MODE_EPPSWE:
 		DPRINTK(KERN_DEBUG "%s: Using software-emulated EPP mode\n",
 			port->name);
-		if (addr) {
+		if (addr)
 			fn = parport_ieee1284_epp_read_addr;
-		} else {
+		else
 			fn = parport_ieee1284_epp_read_data;
-		}
+
 		break;
 	case IEEE1284_MODE_ECP:
 	case IEEE1284_MODE_ECPRLE:
diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c
index b431ab6349fe..bc1c0e5f9199 100644
--- a/drivers/parport/ieee1284_ops.c
+++ b/drivers/parport/ieee1284_ops.c
@@ -251,9 +251,8 @@ size_t parport_ieee1284_read_byte(struct parport *port,
 		unsigned char byte;
 
 		/* Data available? */
-		if (parport_read_status(port) & PARPORT_STATUS_ERROR) {
+		if (parport_read_status(port) & PARPORT_STATUS_ERROR)
 			goto end_of_data;
-		}
 
 		/* Event 14: Place data bus in high impedance state. */
 		parport_data_reverse(port);
@@ -796,9 +795,8 @@ size_t parport_ieee1284_epp_read_data(struct parport *port,
 				      PARPORT_CONTROL_AUTOFD,
 				      PARPORT_CONTROL_AUTOFD);
 		/* Event 58: wait for Busy to go high */
-		if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0)) {
+		if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0))
 			break;
-		}
 
 		*bp = parport_read_data(port);
 
@@ -884,9 +882,8 @@ size_t parport_ieee1284_epp_read_addr(struct parport *port,
 				      PARPORT_CONTROL_SELECT);
 
 		/* Event 58: wait for Busy to go high */
-		if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0)) {
+		if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0))
 			break;
-		}
 
 		*bp = parport_read_data(port);
 
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
index 9c2493fa29ff..e11c09874ad0 100644
--- a/drivers/parport/parport_gsc.c
+++ b/drivers/parport/parport_gsc.c
@@ -290,15 +290,14 @@ struct parport *parport_gsc_probe_port(unsigned long base,
 
 	printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
 	p->irq = irq;
-	if (p->irq == PARPORT_IRQ_AUTO) {
+	if (p->irq == PARPORT_IRQ_AUTO)
 		p->irq = PARPORT_IRQ_NONE;
-	}
+
 	if (p->irq != PARPORT_IRQ_NONE) {
 		pr_cont(", irq %d", p->irq);
 
-		if (p->dma == PARPORT_DMA_AUTO) {
+		if (p->dma == PARPORT_DMA_AUTO)
 			p->dma = PARPORT_DMA_NONE;
-		}
 	}
 	if (p->dma == PARPORT_DMA_AUTO) /* To use DMA, giving the irq
                                            is mandatory (see above) */
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 5548193a28a6..15d7693f8202 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -1729,9 +1729,8 @@ static int intel_bug_present_check_epp(struct parport *pb)
 static int intel_bug_present(struct parport *pb)
 {
 /* Check whether the device is legacy, not PCI or PCMCIA. Only legacy is known to be affected. */
-	if (pb->dev != NULL) {
+	if (pb->dev != NULL)
 		return 0;
-	}
 
 	return intel_bug_present_check_epp(pb);
 }
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index 6037008579f1..50820fa1750f 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -142,32 +142,28 @@ static unsigned char parport_sunbpp_frob_control(struct parport *p,
 	dprintk((KERN_DEBUG "frob1: tcr 0x%x or 0x%x\n",
 		 value_tcr, value_or));
 	if (mask & PARPORT_CONTROL_STROBE) {
-		if (val & PARPORT_CONTROL_STROBE) {
+		if (val & PARPORT_CONTROL_STROBE)
 			value_tcr &= ~P_TCR_DS;
-		} else {
+		else
 			value_tcr |= P_TCR_DS;
-		}
 	}
 	if (mask & PARPORT_CONTROL_AUTOFD) {
-		if (val & PARPORT_CONTROL_AUTOFD) {
+		if (val & PARPORT_CONTROL_AUTOFD)
 			value_or &= ~P_OR_AFXN;
-		} else {
+		else
 			value_or |= P_OR_AFXN;
-		}
 	}
 	if (mask & PARPORT_CONTROL_INIT) {
-		if (val & PARPORT_CONTROL_INIT) {
+		if (val & PARPORT_CONTROL_INIT)
 			value_or &= ~P_OR_INIT;
-		} else {
+		else
 			value_or |= P_OR_INIT;
-		}
 	}
 	if (mask & PARPORT_CONTROL_SELECT) {
-		if (val & PARPORT_CONTROL_SELECT) {
+		if (val & PARPORT_CONTROL_SELECT)
 			value_or |= P_OR_SLCT_IN;
-		} else {
+		else
 			value_or &= ~P_OR_SLCT_IN;
-		}
 	}
 
 	sbus_writeb(value_or, &regs->p_or);
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 6ee97b5849c5..e42f03f2d24e 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -49,14 +49,12 @@ static int do_active_device(struct ctl_table *table, int write,
 	}
 	
 	for (dev = port->devices; dev ; dev = dev->next) {
-		if(dev == port->cad) {
+		if(dev == port->cad)
 			len += sprintf(buffer, "%s\n", dev->name);
-		}
 	}
 
-	if(!len) {
+	if(!len)
 		len += sprintf(buffer, "%s\n", "none");
-	}
 
 	if (len > *lenp)
 		len = *lenp;
-- 
2.11.0

      parent reply	other threads:[~2017-07-17 16:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 16:36 [PATCH 0/5] parport: cleanup several checkpatch issues Carlos Palminha
2017-07-17 16:36 ` [PATCH 1/5] parport: add newline to trailing statements Carlos Palminha
2017-08-07 20:42   ` Sudip Mukherjee
2017-07-17 16:36 ` [PATCH 2/5] parport: cleanup prohibited space after functions name Carlos Palminha
2017-08-07 20:49   ` Sudip Mukherjee
2017-07-17 16:37 ` [PATCH 3/5] parport: cleanup statics initialization to NULL or 0 Carlos Palminha
2017-07-17 16:37 ` [PATCH 4/5] parport: move open braces to the same line Carlos Palminha
2017-07-17 16:40 ` Carlos Palminha [this message]

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=20170717164018.17494-1-palminha@synopsys.com \
    --to=carlos.palminha@synopsys.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parport@lists.infradead.org \
    --cc=sudip.mukherjee@codethink.co.uk \
    --cc=sudipm.mukherjee@gmail.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

all inboxes | Powered by JetHome®