Skip to contentSkip to conversation

staging: ks7010: Fix multiple checkpatch warnings

PATCH In review sayli karnik 3 participants 14 messages Sep 16, 2016 – Sep 19, 2016 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: ks7010: Fix multiple checkpatch warnings

This patchset fixes several checkpatch issues detected in the ks7010_sdio.c file of the ks7010 driver.

Changes in v2:
Corrected the subject line
Added a patch to remove extra braces
Removed code under comments in patch 3/6

sayli karnik (6):
Use #include <linux/atomic.h> instead of <asm/atomic.h> Remove braces following single statement blocks Remove space after '(' and before ')'
Remove unnecessary blank lines
Remove the space after a type cast
Remove extra round braces around expressions/variables

 drivers/staging/ks7010/ks7010_sdio.c | 63 ++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 35 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/6 staging: ks7010: Use #include <linux/atomic.h> instead of <asm/atomic.h>

This patch replaces <asm/atomic.h> with <linux/atomic.h>, as suggested by checkpatch.pl.

---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ks7010/ks7010_sdio.c +1 -1
index d5299f0..b993804 100644
@@ -14,7 +14,7 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/sdio_func.h>
 #include <linux/workqueue.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include "ks_wlan.h"
 #include "ks_wlan_ioctl.h"
Signature · 1 line
2.7.4
maintainer
#2 lore raw

Re: [PATCH v3 1/6] staging: ks7010: Use #include <linux/atomic.h> instead of <asm/atomic.h>

Quoted 7 lines · sayli karnik

This patch replaces <asm/atomic.h> with <linux/atomic.h>, as suggested by checkpatch.pl.

---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

One patch here says "v3" yet others say "v2", so they can't be sorted in order :(

Please fix up the series, make them all the same version (as they are), and resend the whole thing.

thanks,

greg k-h

#3 lore raw

PATCH v2 2/6 staging: ks7010: Remove braces following single statement blocks

In reply to sayli karnik

The patch removes braces {} for single statement blocks, as suggested by checkpatch.pl.

---
 drivers/staging/ks7010/ks7010_sdio.c | 38 +++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 20 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +18 -20
index b993804..8e1f68a 100644
@@ -157,9 +157,9 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 		rw_data = WAKEUP_REQ;
 		retval =
 		    ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
-		if (retval) {
+		if (retval)
 			DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
-		}
+
 		DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
 		priv->last_wakeup = jiffies;
 		++priv->wakeup_count;
@@ -398,9 +398,8 @@ static void rx_event_task(unsigned long dev)
 		hostif_receive(priv, rp->data, rp->size);
 		inc_rxqhead(priv);
 
-		if (cnt_rxqbody(priv) > 0) {
+		if (cnt_rxqbody(priv) > 0)
 			tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
-		}
 	}
 }
 
@@ -426,9 +425,8 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 	retval =
 	    ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0],
 			     hif_align_size(size));
-	if (retval) {
+	if (retval)
 		goto error_out;
-	}
 
 	/* length check */
 	if (size > 2046 || size == 0) {
@@ -443,9 +441,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 		retval =
 		    ks7010_sdio_write(priv, READ_STATUS, &read_status,
 				      sizeof(read_status));
-		if (retval) {
+		if (retval)
 			DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-		}
+
 		goto error_out;
 	}
 
@@ -459,9 +457,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 	retval =
 	    ks7010_sdio_write(priv, READ_STATUS, &read_status,
 			      sizeof(read_status));
-	if (retval) {
+	if (retval)
 		DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-	}
+
 	DPRINTK(4, "READ_STATUS=%02X\n", read_status);
 
 	if (atomic_read(&priv->psstatus.confirm_wait)) {
@@ -545,9 +543,9 @@ static void ks7010_rw_function(struct work_struct *work)
 		ks_wlan_hw_rx((void *)priv,
 			      (uint16_t) (((rw_data & RSIZE_MASK) << 4)));
 	}
-	if ((rw_data & WSTATUS_MASK)) {
+	if ((rw_data & WSTATUS_MASK))
 		tx_device_task((void *)priv);
-	}
+
 	_ks_wlan_hw_power_save(priv);
 
  err_out:
@@ -884,9 +882,9 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
 		DPRINTK(1, "wait time out!! SME_START\n");
 	}
 
-	if (priv->mac_address_valid && priv->version_size) {
+	if (priv->mac_address_valid && priv->version_size)
 		priv->dev_state = DEVICE_STATE_PREINIT;
-	}
+
 
 	hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);
 
@@ -1029,9 +1027,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
 	priv->ks_wlan_hw.read_buf = NULL;
 	priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
-	if (!priv->ks_wlan_hw.read_buf) {
+	if (!priv->ks_wlan_hw.read_buf)
 		goto error_free_netdev;
-	}
+
 	priv->dev_state = DEVICE_STATE_PREBOOT;
 	priv->net_dev = netdev;
 	priv->firmware_version[0] = '\0';
@@ -1067,9 +1065,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	sdio_claim_host(func);
 	ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
 	sdio_release_host(func);
-	if (ret) {
+	if (ret)
 		DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
-	}
+
 	DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
 
 	/* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
@@ -1077,9 +1075,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	sdio_claim_host(func);
 	ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
 	sdio_release_host(func);
-	if (ret) {
+	if (ret)
 		DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
-	}
+
 	DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
 	priv->dev_state = DEVICE_STATE_BOOT;
 
Signature · 1 line
2.7.4
#4 lore raw

Re: [Outreachy kernel] [PATCH v3 2/6] staging: ks7010: Remove braces following single statement blocks

Quoted 2 lines · sayli karnik

The patch removes braces {} for single statement blocks, as suggested by checkpatch.pl.

Why do you add blank lines everywhere?

julia

Quoted 137 lines
---
 drivers/staging/ks7010/ks7010_sdio.c | 38 +++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 20 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +18 -21
index b993804..8e1f68a 100644
@@ -157,9 +157,9 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 		rw_data = WAKEUP_REQ;
 		retval =
 		    ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
-		if (retval) {
+		if (retval)
 			DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
-		}
+
 		DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
 		priv->last_wakeup = jiffies;
 		++priv->wakeup_count;
@@ -398,9 +398,8 @@ static void rx_event_task(unsigned long dev)
 		hostif_receive(priv, rp->data, rp->size);
 		inc_rxqhead(priv);
 
-		if (cnt_rxqbody(priv) > 0) {
+		if (cnt_rxqbody(priv) > 0)
 			tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
-		}
 	}
 }
 
@@ -426,9 +425,8 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 	retval =
 	    ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0],
 			     hif_align_size(size));
-	if (retval) {
+	if (retval)
 		goto error_out;
-	}
 
 	/* length check */
 	if (size > 2046 || size == 0) {
@@ -443,9 +441,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 		retval =
 		    ks7010_sdio_write(priv, READ_STATUS, &read_status,
 				      sizeof(read_status));
-		if (retval) {
+		if (retval)
 			DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-		}
+
 		goto error_out;
 	}
 
@@ -459,9 +457,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 	retval =
 	    ks7010_sdio_write(priv, READ_STATUS, &read_status,
 			      sizeof(read_status));
-	if (retval) {
+	if (retval)
 		DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-	}
+
 	DPRINTK(4, "READ_STATUS=%02X\n", read_status);
 
 	if (atomic_read(&priv->psstatus.confirm_wait)) {
@@ -545,9 +543,9 @@ static void ks7010_rw_function(struct work_struct *work)
 		ks_wlan_hw_rx((void *)priv,
 			      (uint16_t) (((rw_data & RSIZE_MASK) << 4)));
 	}
-	if ((rw_data & WSTATUS_MASK)) {
+	if ((rw_data & WSTATUS_MASK))
 		tx_device_task((void *)priv);
-	}
+
 	_ks_wlan_hw_power_save(priv);
 
  err_out:
@@ -884,9 +882,9 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
 		DPRINTK(1, "wait time out!! SME_START\n");
 	}
 
-	if (priv->mac_address_valid && priv->version_size) {
+	if (priv->mac_address_valid && priv->version_size)
 		priv->dev_state = DEVICE_STATE_PREINIT;
-	}
+
 
 	hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);
 
@@ -1029,9 +1027,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
 	priv->ks_wlan_hw.read_buf = NULL;
 	priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
-	if (!priv->ks_wlan_hw.read_buf) {
+	if (!priv->ks_wlan_hw.read_buf)
 		goto error_free_netdev;
-	}
+
 	priv->dev_state = DEVICE_STATE_PREBOOT;
 	priv->net_dev = netdev;
 	priv->firmware_version[0] = '\0';
@@ -1067,9 +1065,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	sdio_claim_host(func);
 	ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
 	sdio_release_host(func);
-	if (ret) {
+	if (ret)
 		DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
-	}
+
 	DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
 
 	/* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
@@ -1077,9 +1075,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	sdio_claim_host(func);
 	ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
 	sdio_release_host(func);
-	if (ret) {
+	if (ret)
 		DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
-	}
+
 	DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
 	priv->dev_state = DEVICE_STATE_BOOT;
 
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/38a21c2a1b3bc3476860cfe2080ef85816569e7f.1474032241.git.karniksayli1995%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw

Re: [Outreachy kernel] [PATCH v3 2/6] staging: ks7010: Remove braces following single statement blocks

Quoted 9 lines · Julia Lawall
Quoted 2 lines · sayli karnik

The patch removes braces {} for single statement blocks, as suggested by checkpatch.pl.

Why do you add blank lines everywhere?

I thought it was better that way, even checkpatch.pl did not complain. Should I amend it?

thanks
sayli

Quoted 139 lines

julia

Quoted 137 lines
---
 drivers/staging/ks7010/ks7010_sdio.c | 38 +++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 20 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +18 -21
index b993804..8e1f68a 100644
@@ -157,9 +157,9 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
              rw_data = WAKEUP_REQ;
              retval =
                  ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
-             if (retval) {
+             if (retval)
                      DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
-             }
+
              DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
              priv->last_wakeup = jiffies;
              ++priv->wakeup_count;
@@ -398,9 +398,8 @@ static void rx_event_task(unsigned long dev)
              hostif_receive(priv, rp->data, rp->size);
              inc_rxqhead(priv);
 
-             if (cnt_rxqbody(priv) > 0) {
+             if (cnt_rxqbody(priv) > 0)
                      tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
-             }
      }
 }
 
@@ -426,9 +425,8 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
      retval =
          ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0],
                           hif_align_size(size));
-     if (retval) {
+     if (retval)
              goto error_out;
-     }
 
      /* length check */
      if (size > 2046 || size == 0) {
@@ -443,9 +441,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
              retval =
                  ks7010_sdio_write(priv, READ_STATUS, &read_status,
                                    sizeof(read_status));
-             if (retval) {
+             if (retval)
                      DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-             }
+
              goto error_out;
      }
 
@@ -459,9 +457,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
      retval =
          ks7010_sdio_write(priv, READ_STATUS, &read_status,
                            sizeof(read_status));
-     if (retval) {
+     if (retval)
              DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-     }
+
      DPRINTK(4, "READ_STATUS=%02X\n", read_status);
 
      if (atomic_read(&priv->psstatus.confirm_wait)) {
@@ -545,9 +543,9 @@ static void ks7010_rw_function(struct work_struct *work)
              ks_wlan_hw_rx((void *)priv,
                            (uint16_t) (((rw_data & RSIZE_MASK) << 4)));
      }
-     if ((rw_data & WSTATUS_MASK)) {
+     if ((rw_data & WSTATUS_MASK))
              tx_device_task((void *)priv);
-     }
+
      _ks_wlan_hw_power_save(priv);
 
  err_out:
@@ -884,9 +882,9 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
              DPRINTK(1, "wait time out!! SME_START\n");
      }
 
-     if (priv->mac_address_valid && priv->version_size) {
+     if (priv->mac_address_valid && priv->version_size)
              priv->dev_state = DEVICE_STATE_PREINIT;
-     }
+
 
      hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);
 
@@ -1029,9 +1027,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
      init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
      priv->ks_wlan_hw.read_buf = NULL;
      priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
-     if (!priv->ks_wlan_hw.read_buf) {
+     if (!priv->ks_wlan_hw.read_buf)
              goto error_free_netdev;
-     }
+
      priv->dev_state = DEVICE_STATE_PREBOOT;
      priv->net_dev = netdev;
      priv->firmware_version[0] = '\0';
@@ -1067,9 +1065,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
      sdio_claim_host(func);
      ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
      sdio_release_host(func);
-     if (ret) {
+     if (ret)
              DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
-     }
+
      DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
 
      /* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
@@ -1077,9 +1075,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
      sdio_claim_host(func);
      ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
      sdio_release_host(func);
-     if (ret) {
+     if (ret)
              DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
-     }
+
      DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
      priv->dev_state = DEVICE_STATE_BOOT;
 
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/38a21c2a1b3bc3476860cfe2080ef85816569e7f.1474032241.git.karniksayli1995%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#6 lore raw

Re: [Outreachy kernel] [PATCH v3 2/6] staging: ks7010: Remove braces following single statement blocks

Quoted 5 lines · sayli karnik
Quoted 4 lines · Julia Lawall

On Sun, 18 Sep 2016, sayli karnik wrote:

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

The patch removes braces {} for single statement blocks, as suggested by checkpatch.pl.

Why do you add blank lines everywhere?

I thought it was better that way, even checkpatch.pl did not complain. Should I amend it?

I guess blank lines are a matter of taste, and if you think it looks better then no problem :)

julia

Quoted 151 lines

thanks
sayli

Quoted 132 lines

julia

Quoted 130 lines
---
 drivers/staging/ks7010/ks7010_sdio.c | 38 +++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 20 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +18 -21
index b993804..8e1f68a 100644
@@ -157,9 +157,9 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
              rw_data = WAKEUP_REQ;
              retval =
                  ks7010_sdio_write(priv, WAKEUP, &rw_data, sizeof(rw_data));
-             if (retval) {
+             if (retval)
                      DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
-             }
+
              DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
              priv->last_wakeup = jiffies;
              ++priv->wakeup_count;
@@ -398,9 +398,8 @@ static void rx_event_task(unsigned long dev)
              hostif_receive(priv, rp->data, rp->size);
              inc_rxqhead(priv);
 
-             if (cnt_rxqbody(priv) > 0) {
+             if (cnt_rxqbody(priv) > 0)
                      tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
-             }
      }
 }
 
@@ -426,9 +425,8 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
      retval =
          ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0],
                           hif_align_size(size));
-     if (retval) {
+     if (retval)
              goto error_out;
-     }
 
      /* length check */
      if (size > 2046 || size == 0) {
@@ -443,9 +441,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
              retval =
                  ks7010_sdio_write(priv, READ_STATUS, &read_status,
                                    sizeof(read_status));
-             if (retval) {
+             if (retval)
                      DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-             }
+
              goto error_out;
      }
 
@@ -459,9 +457,9 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
      retval =
          ks7010_sdio_write(priv, READ_STATUS, &read_status,
                            sizeof(read_status));
-     if (retval) {
+     if (retval)
              DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
-     }
+
      DPRINTK(4, "READ_STATUS=%02X\n", read_status);
 
      if (atomic_read(&priv->psstatus.confirm_wait)) {
@@ -545,9 +543,9 @@ static void ks7010_rw_function(struct work_struct *work)
              ks_wlan_hw_rx((void *)priv,
                            (uint16_t) (((rw_data & RSIZE_MASK) << 4)));
      }
-     if ((rw_data & WSTATUS_MASK)) {
+     if ((rw_data & WSTATUS_MASK))
              tx_device_task((void *)priv);
-     }
+
      _ks_wlan_hw_power_save(priv);
 
  err_out:
@@ -884,9 +882,9 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
              DPRINTK(1, "wait time out!! SME_START\n");
      }
 
-     if (priv->mac_address_valid && priv->version_size) {
+     if (priv->mac_address_valid && priv->version_size)
              priv->dev_state = DEVICE_STATE_PREINIT;
-     }
+
 
      hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);
 
@@ -1029,9 +1027,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
      init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
      priv->ks_wlan_hw.read_buf = NULL;
      priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
-     if (!priv->ks_wlan_hw.read_buf) {
+     if (!priv->ks_wlan_hw.read_buf)
              goto error_free_netdev;
-     }
+
      priv->dev_state = DEVICE_STATE_PREBOOT;
      priv->net_dev = netdev;
      priv->firmware_version[0] = '\0';
@@ -1067,9 +1065,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
      sdio_claim_host(func);
      ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
      sdio_release_host(func);
-     if (ret) {
+     if (ret)
              DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
-     }
+
      DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
 
      /* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
@@ -1077,9 +1075,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
      sdio_claim_host(func);
      ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
      sdio_release_host(func);
-     if (ret) {
+     if (ret)
              DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
-     }
+
      DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
      priv->dev_state = DEVICE_STATE_BOOT;
 
--

2.7.4

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/38a21c2a1b3bc3476860cfe2080ef85816569e7f.1474032241.git.karniksayli1995%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAKG5xWizCzdeFj4cLg1Ghs%3D90uu-8XK1Rvnam5qMxQr7L9PfaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw

PATCH v2 3/6 staging: ks7010: Remove space after '(' and before ')'

In reply to sayli karnik

The patch fixes the following errors detected by checkpatch.pl:
ERROR: space prohibited before that close parenthesis ')'
ERROR: space prohibited after that open parenthesis '('

---
 drivers/staging/ks7010/ks7010_sdio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +6 -6
index 8e1f68a..b0c6f93 100644
@@ -35,18 +35,18 @@ MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 /* macro */
 
 #define inc_txqhead(priv) \
-        ( priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE )
+        (priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
 #define inc_txqtail(priv) \
-        ( priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE )
+        (priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE)
 #define cnt_txqbody(priv) \
-        (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE )
+        (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % TX_DEVICE_BUFF_SIZE)
 
 #define inc_rxqhead(priv) \
-        ( priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE )
+        (priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE)
 #define inc_rxqtail(priv) \
-        ( priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE )
+        (priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE)
 #define cnt_rxqbody(priv) \
-        (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE )
+        (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % RX_DEVICE_BUFF_SIZE)
 
 static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
 			    unsigned char *buffer, int length)
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 4/6 staging: ks7010: Remove unnecessary blank lines

In reply to sayli karnik

The patch removes unnecessary blank lines as detected by checkpatch.pl.

---
v2: Code under comments removed as suggested by Julia.

 drivers/staging/ks7010/ks7010_sdio.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +0 -5
index b0c6f93..bee7504 100644
@@ -180,8 +180,6 @@ int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 
 	if (priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
 	    (priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
-
-		//DPRINTK(1,"psstatus.status=%d\n",atomic_read(&priv->psstatus.status));
 		if (priv->dev_state == DEVICE_STATE_SLEEP) {
 			switch (atomic_read(&priv->psstatus.status)) {
 			case PS_SNOOZE:	/* 4 */
@@ -244,7 +242,6 @@ int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 				break;
 			}
 		}
-
 	}
 
 	return rc;
@@ -343,7 +340,6 @@ static void tx_device_task(void *dev)
 						   &priv->ks_wlan_hw.rw_wq, 1);
 				return;
 			}
-
 		}
 		kfree(sp->sendp);	/* allocated memory free */
 		if (sp->complete_handler)	/* TX Complete */
@@ -597,7 +593,6 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 				}
 				complete(&priv->psstatus.wakeup_wait);
 			}
-
 		}
 
 		do {
Signature · 1 line
2.7.4
maintainer
#9 lore raw

Re: [PATCH v2 4/6] staging: ks7010: Remove unnecessary blank lines

Quoted 14 lines · sayli karnik

The patch removes unnecessary blank lines as detected by checkpatch.pl.

---
v2: Code under comments removed as suggested by Julia.

 drivers/staging/ks7010/ks7010_sdio.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +0 -0
index b0c6f93..bee7504 100644

drivers/staging/ks7010/ks7010_sdio.c int _ks_wlan_hw_power_save(struct ks_wlan_private *priv) · line 184

Quoted 5 lines
drivers/staging/ks7010/ks7010_sdio.c +0 -2
@@ -180,8 +180,6 @@ int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 
 	if (priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
 	    (priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
-
-		//DPRINTK(1,"psstatus.status=%d\n",atomic_read(&priv->psstatus.status));

That is not a "unnecessary blank line" :(

Please update your changelog text when you do something else in the patch...

thanks,

greg k-h

#10 lore raw

Re: [PATCH v2 4/6] staging: ks7010: Remove unnecessary blank lines

Quoted 23 lines · Greg KH
Quoted 14 lines · sayli karnik

The patch removes unnecessary blank lines as detected by checkpatch.pl.

---
v2: Code under comments removed as suggested by Julia.

 drivers/staging/ks7010/ks7010_sdio.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +0 -0
index b0c6f93..bee7504 100644

drivers/staging/ks7010/ks7010_sdio.c int _ks_wlan_hw_power_save(struct ks_wlan_private *priv) · line 184

Quoted 5 lines
drivers/staging/ks7010/ks7010_sdio.c +0 -2
@@ -180,8 +180,6 @@ int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 
      if (priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
          (priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
-
-             //DPRINTK(1,"psstatus.status=%d\n",atomic_read(&priv->psstatus.status));

That is not a "unnecessary blank line" :(

Quoted 6 lines

Please update your changelog text when you do something else in the patch...

thanks,

greg k-h

Yes I'll update the changelog and send a v3.

thanks,

sayli

#11 lore raw

PATCH v2 5/6 staging: ks7010: Remove the space after a type cast

In reply to sayli karnik

The patch removes an unnecessary space after a cast, as detected by checkpatch.pl.

---
 drivers/staging/ks7010/ks7010_sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +3 -3
index bee7504..489291b 100644
@@ -537,7 +537,7 @@ static void ks7010_rw_function(struct work_struct *work)
 
 	if (rw_data & RSIZE_MASK) {	/* Read schedule */
 		ks_wlan_hw_rx((void *)priv,
-			      (uint16_t) (((rw_data & RSIZE_MASK) << 4)));
+			      (uint16_t)(((rw_data & RSIZE_MASK) << 4)));
 	}
 	if ((rw_data & WSTATUS_MASK))
 		tx_device_task((void *)priv);
@@ -609,7 +609,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 			rsize = rw_data & RSIZE_MASK;
 			if (rsize) {	/* Read schedule */
 				ks_wlan_hw_rx((void *)priv,
-					      (uint16_t) (((rsize) << 4)));
+					      (uint16_t)(((rsize) << 4)));
 			}
 			if (rw_data & WSTATUS_MASK) {
 #if 0
@@ -1150,7 +1150,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 			    cpu_to_le16((uint16_t)
 					(sizeof(*pp) -
 					 sizeof(pp->header.size)));
-			pp->header.event = cpu_to_le16((uint16_t) HIF_STOP_REQ);
+			pp->header.event = cpu_to_le16((uint16_t)HIF_STOP_REQ);
 
 			sdio_claim_host(func);
 			write_to_device(priv, (unsigned char *)pp,
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 6/6 staging: ks7010: Remove extra round braces around expressions/variables

In reply to sayli karnik

This patch removes excess round braces around expressions/variables.

---
 drivers/staging/ks7010/ks7010_sdio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +2 -2
index 489291b..767b04b 100644
@@ -537,7 +537,7 @@ static void ks7010_rw_function(struct work_struct *work)
 
 	if (rw_data & RSIZE_MASK) {	/* Read schedule */
 		ks_wlan_hw_rx((void *)priv,
-			      (uint16_t)(((rw_data & RSIZE_MASK) << 4)));
+			      (uint16_t)((rw_data & RSIZE_MASK) << 4));
 	}
 	if ((rw_data & WSTATUS_MASK))
 		tx_device_task((void *)priv);
@@ -609,7 +609,7 @@ static void ks_sdio_interrupt(struct sdio_func *func)
 			rsize = rw_data & RSIZE_MASK;
 			if (rsize) {	/* Read schedule */
 				ks_wlan_hw_rx((void *)priv,
-					      (uint16_t)(((rsize) << 4)));
+					      (uint16_t)(rsize << 4));
 			}
 			if (rw_data & WSTATUS_MASK) {
 #if 0
Signature · 1 line
2.7.4
maintainer
#13 lore raw
In reply to sayli karnik
Quoted 2 lines · sayli karnik

This patchset fixes several checkpatch issues detected in the ks7010_sdio.c file of the ks7010 driver.

You only sent 1 patch in this series :(

Please send all 6.

thanks,

greg k-h