[PATCH 8/9] staging: ks7010: Refactor code

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

 



Code is able to be refactored. Various assignments have the assigning
value on a separate line.

Refactor code bring it closer to kernel standards.

Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
---
 drivers/staging/ks7010/ks7010_sdio.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 5a69468..3119ee2 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -547,9 +547,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 	if (priv->dev_state < DEVICE_STATE_BOOT)
 		goto intr_out;
 
-	retval =
-		ks7010_sdio_read(priv, INT_PENDING, &status,
-				sizeof(status));
+	retval = ks7010_sdio_read(priv, INT_PENDING, &status, sizeof(status));
 	if (retval) {
 		DPRINTK(1, "read INT_PENDING Failed!!(%d)\n", retval);
 		goto intr_out;
@@ -563,19 +561,15 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 	/* bit2 -> Read Status Busy  */
 	if (status & INT_GCR_B
 		|| atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
-		retval =
-			ks7010_sdio_read(priv, GCR_B, &rw_data,
-					sizeof(rw_data));
+		retval = ks7010_sdio_read(priv, GCR_B, &rw_data, sizeof(rw_data));
 		if (retval) {
 			DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
 			goto intr_out;
 		}
 		/* DPRINTK(1, "GCR_B=%02X\n", rw_data); */
 		if (rw_data == GCR_B_ACTIVE) {
-			if (atomic_read(&priv->psstatus.status) ==
-				PS_SNOOZE) {
-				atomic_set(&priv->psstatus.status,
-					PS_WAKEUP);
+			if (atomic_read(&priv->psstatus.status) == PS_SNOOZE) {
+				atomic_set(&priv->psstatus.status, PS_WAKEUP);
 				priv->wakeup_count = 0;
 			}
 			complete(&priv->psstatus.wakeup_wait);
@@ -584,28 +578,23 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 
 	do {
 		/* read (WriteStatus/ReadDataSize FN1:00_0014) */
-		retval =
-			ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data,
+		retval = ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data,
 					sizeof(rw_data));
 		if (retval) {
-			DPRINTK(1, " error : WSTATUS_RSIZE=%02X\n",
-				rw_data);
+			DPRINTK(1, " error : WSTATUS_RSIZE=%02X\n", rw_data);
 			goto intr_out;
 		}
 		DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
 		rsize = rw_data & RSIZE_MASK;
 		if (rsize) {	/* Read schedule */
-			ks_wlan_hw_rx((void *)priv,
-				(uint16_t)(rsize << 4));
+			ks_wlan_hw_rx((void *)priv, (uint16_t)(rsize << 4));
 		}
 		if (rw_data & WSTATUS_MASK) {
 #if 0
-			if (status & INT_WRITE_STATUS
-				&& !cnt_txqbody(priv)) {
+			if (status & INT_WRITE_STATUS && !cnt_txqbody(priv)) {
 				/* dummy write for interrupt clear */
 				rw_data = 0;
-				retval =
-					ks7010_sdio_write(priv, DATA_WINDOW,
+				retval = ks7010_sdio_write(priv, DATA_WINDOW,
 							&rw_data,
 							sizeof(rw_data));
 				if (retval) {
-- 
2.7.4

_______________________________________________
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