[Linux-parport] [PATCH 5/5] parport: remove unnecessary braces

Carlos Palminha CARLOS.PALMINHA at synopsys.com
Mon Jul 17 09:40:18 PDT 2017


based on checkpatch, remove braces not necessary for statements.

Signed-off-by: Carlos Palminha <palminha at 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




More information about the Linux-parport mailing list