[PATCH 5/5] staging: wlags49_h2: Correct coding style in wl_netdev.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove space between parenthesis.
Test with simple statement does not need brackets.
Simplify test condition

Signed-off-by: Mathieu Maret <mathieu.maret@xxxxxxxxx>
---
 drivers/staging/wlags49_h2/wl_netdev.c | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c
index 6455956..22d9ba3 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -113,7 +113,7 @@
 		status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0) \
 	} while (0)
 
-#define BLOCK_INPUT_DMA(buf, len) memcpy( buf, desc_next->buf_addr, pktlen )
+#define BLOCK_INPUT_DMA(buf, len) memcpy(buf, desc_next->buf_addr, pktlen)
 
 /*******************************************************************************
  * function prototypes
@@ -225,17 +225,15 @@ struct net_device_stats *wl_stats(struct net_device *dev)
 #ifdef USE_WDS
 
 	for (count = 0; count < NUM_WDS_PORTS; count++) {
-		if (dev == lp->wds_port[count].dev) {
+		if (dev == lp->wds_port[count].dev)
 			pStats = &(lp->wds_port[count].stats);
-		}
 	}
 
 #endif /* USE_WDS */
 
 	/* If pStats is still NULL, then the device is not a WDS port */
-	if (pStats == NULL) {
+	if (pStats == NULL)
 		pStats = &(lp->stats);
-	}
 
 	wl_unlock(lp, &flags);
 
@@ -578,9 +576,8 @@ void wl_tx_timeout(struct net_device *dev)
 #endif /* USE_WDS */
 
 	/* If pStats is still NULL, then the device is not a WDS port */
-	if (pStats == NULL) {
+	if (pStats == NULL)
 		pStats = &(lp->stats);
-	}
 
 	/* Accumulate the timeout error */
 	pStats->tx_errors++;
@@ -663,9 +660,8 @@ int wl_send(struct wl_private *lp)
 		}
 	}
 
-	if (lp->txF.skb == NULL) {
+	if (lp->txF.skb == NULL)
 		return FALSE;
-	}
 
 	/* If the device has resources (FIDs) available, then Tx the packet */
 	/* Format the TxRequest and send it to the adapter */
@@ -926,9 +922,8 @@ int wl_rx(struct net_device *dev)
 					DBG_ERROR(DbgInfo,
 						  "Rx request to card FAILED\n");
 
-					if (port == 0) {
+					if (port == 0)
 						lp->stats.rx_dropped++;
-					}
 #ifdef USE_WDS
 					else {
 						lp->wds_port[port -
@@ -942,9 +937,8 @@ int wl_rx(struct net_device *dev)
 			} else {
 				DBG_ERROR(DbgInfo, "Could not alloc skb\n");
 
-				if (port == 0) {
+				if (port == 0)
 					lp->stats.rx_dropped++;
-				}
 #ifdef USE_WDS
 				else {
 					lp->wds_port[port -
@@ -1657,9 +1651,8 @@ void wl_wds_netif_carrier_on(struct wl_private *lp)
 
 	if (lp != NULL) {
 		for (count = 0; count < NUM_WDS_PORTS; count++) {
-			if (lp->wds_port[count].is_registered) {
+			if (lp->wds_port[count].is_registered)
 				netif_carrier_on(lp->wds_port[count].dev);
-			}
 		}
 	}
 }				/* wl_wds_netif_carrier_on */
@@ -1819,7 +1812,8 @@ int wl_rx_dma(struct net_device *dev)
 
 	DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
-	if (((lp = dev->priv) != NULL) && !(lp->flags & WVLAN2_UIL_BUSY)) {
+	lp = dev->priv;
+	if ((lp != NULL) && !(lp->flags & WVLAN2_UIL_BUSY)) {
 
 #ifdef USE_RTS
 		if (lp->useRTS == 1) {
@@ -1935,9 +1929,8 @@ int wl_rx_dma(struct net_device *dev)
 					DBG_ERROR(DbgInfo,
 						  "Could not alloc skb\n");
 
-					if (port == 0) {
+					if (port == 0)
 						lp->stats.rx_dropped++;
-					}
 #ifdef USE_WDS
 					else {
 						lp->wds_port[port -
-- 
1.9.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux