[PATCH] Ensure that comments adhere to coding standard

2016-04-03 Thread mohammed . billoo
From: Mohammed Billoo 

Files in wilc1000 were modified to ensure that comments
adhere to standard specified by Documentation/CodingStyle

Signed-off-by: Mohammed Billoo 
---
 drivers/staging/wilc1000/host_interface.c |   6 +-
 drivers/staging/wilc1000/linux_mon.c  |  19 ++-
 drivers/staging/wilc1000/wilc_debugfs.c   |  12 +-
 drivers/staging/wilc1000/wilc_sdio.c  | 145 +
 drivers/staging/wilc1000/wilc_spi.c   | 220 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |   4 +-
 drivers/staging/wilc1000/wilc_wlan.h  |  89 ---
 drivers/staging/wilc1000/wilc_wlan_cfg.c  |  46 ++
 drivers/staging/wilc1000/wilc_wlan_cfg.h  |  13 +-
 drivers/staging/wilc1000/wilc_wlan_if.h   |  44 ++
 10 files changed, 194 insertions(+), 404 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0a922c7..b40dce2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -263,7 +263,8 @@ static struct wilc_vif *join_req_vif;
 static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 
-/* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
+/*
+ * The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
  * special purpose in wilc device, so we add 1 to the index to starts from 1.
  * As a result, the returned index will be 1 to NUM_CONCURRENT_IFC.
  */
@@ -272,7 +273,8 @@ int wilc_get_vif_idx(struct wilc_vif *vif)
return vif->idx + 1;
 }
 
-/* We need to minus 1 from idx which is from wilc device to get real index
+/*
+ * We need to minus 1 from idx which is from wilc device to get real index
  * of wilc->vif[], because we add 1 when pass to wilc device in the function
  * wilc_get_vif_idx.
  * As a result, the index should be between 0 and NUM_CONCURRENT_IFC -1.
diff --git a/drivers/staging/wilc1000/linux_mon.c 
b/drivers/staging/wilc1000/linux_mon.c
index 7d9e5de..d8d4be6 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -60,8 +60,10 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
/* Get WILC header */
memcpy(&header, (buff - HOST_HDR_OFFSET), HOST_HDR_OFFSET);
 
-   /* The packet offset field conain info about what type of managment 
frame */
-   /* we are dealing with and ack status */
+   /*
+* The packet offset field conain info about what type of managment
+* frame we are dealing with and ack status
+*/
pkt_offset = GET_PKT_OFFSET(header);
 
if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
@@ -128,7 +130,10 @@ static void mgmt_tx_complete(void *priv, int status)
 {
struct tx_complete_mon_data *pv_data = priv;
 
-   /* incase of fully hosting mode, the freeing will be done in response 
to the cfg packet */
+   /*
+* In case of fully hosting mode, the freeing will be done in response
+* to the cfg packet
+*/
kfree(pv_data->buff);
 
kfree(pv_data);
@@ -227,8 +232,10 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
/* Identify if Ethernet or MAC header (data or mgmt) */
memcpy(srcAdd, &skb->data[10], 6);
memcpy(bssid, &skb->data[16], 6);
-   /* if source address and bssid fields are equal>>Mac header */
-   /*send it to mgmt frames handler */
+   /*
+* If source address and bssid fields are equal>>Mac header
+* send it to mgmt frames handler
+*/
if (!(memcmp(srcAdd, bssid, 6))) {
ret = mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len);
if (ret)
@@ -260,7 +267,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char 
*name, struct net_devi
u32 ret = 0;
struct WILC_WFI_mon_priv *priv;
 
-   /*If monitor interface is already initialized, return it*/
+   /* If monitor interface is already initialized, return it*/
if (wilc_wfi_mon)
return wilc_wfi_mon;
 
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index fcbc95d..4fb819d 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -6,7 +6,6 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
  */
 
 #if defined(WILC_DEBUGFS)
@@ -20,9 +19,7 @@
 
 static struct dentry *wilc_dir;
 
-/*
- * 

- */
+
 #define DEBUG   BIT(0)
 #define INFOBIT(1)
 #define WRN BIT(2)
@@ -32,10 +29,6 @@ static struct dentry *wi

[PATCH] staging: wilc1000: rework comments in wilc_sdio.c

2016-04-09 Thread mohammed . billoo
From: Mohammed Billoo 

Remove unnecessary comments (highlighting sections of functions), make
multiline comments into single line comments, and ensure that multiline
comments adhere to coding style.
---
 drivers/staging/wilc1000/wilc_sdio.c | 136 ---
 1 file changed, 31 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
b/drivers/staging/wilc1000/wilc_sdio.c
index a839a79..a082e12 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -1,11 +1,7 @@
-/* // 
*/
-/*  */
-/* Copyright (c) Atmel Corporation.  All rights reserved. */
-/*  */
-/* Module Name:  wilc_sdio.c */
-/*  */
-/*  */
-/* 
 */
+/* Copyright (c) Atmel Corporation.  All rights reserved.
+ *
+ * Module Name:  wilc_sdio.c
+ */
 
 #include 
 #include "wilc_wlan_if.h"
@@ -257,11 +253,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev)
dev_info(&func->dev, "wilc_sdio_disable_interrupt OUT\n");
 }
 
-/
- *
- *  Function 0
- *
- /
 
 static int sdio_set_func0_csa_address(struct wilc *wilc, u32 adr)
 {
@@ -269,9 +260,7 @@ static int sdio_set_func0_csa_address(struct wilc *wilc, 
u32 adr)
struct sdio_cmd52 cmd;
int ret;
 
-   /**
-*  Review: BIG ENDIAN
-**/
+   /* Review: BIG ENDIAN */
cmd.read_write = 1;
cmd.function = 0;
cmd.raw = 0;
@@ -334,11 +323,6 @@ _fail_:
return 0;
 }
 
-/
- *
- *  Function 1
- *
- /
 
 static int sdio_set_func1_block_size(struct wilc *wilc, u32 block_size)
 {
@@ -369,11 +353,7 @@ _fail_:
return 0;
 }
 
-/
- *
- *  Sdio interfaces
- *
- /
+
 static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data)
 {
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
@@ -398,9 +378,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 
data)
} else {
struct sdio_cmd53 cmd;
 
-   /**
-*  set the AHB address
-**/
+   /* set the AHB address */
if (!sdio_set_func0_csa_address(wilc, addr))
goto _fail_;
 
@@ -436,31 +414,23 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 
*buf, u32 size)
 
cmd.read_write = 1;
if (addr > 0) {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 0 access
-**/
+   /* func 0 access */
cmd.function = 0;
cmd.address = 0x10f;
} else {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 1 access
-**/
+   /* func 1 access */
cmd.function = 1;
cmd.address = 0;
}
@@ -576,31 +546,23 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 
*buf, u32 size)
 
cmd.read_write = 0;
if (addr > 0) {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 0 access
-**/
+   /* func 0 access */
cmd.function = 0;
cmd.address = 0x10f;
} else {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 1 access
-**/
+   /* func 1 access */
cmd.function = 1;
cmd.address = 0;
}
@@ -627,7 +589,7 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, 
u32 size)
if (addr > 0)
addr += nblk * block_size;
  

[PATCH] staging: wilc1000: rework comments in wilc_sdio.c

2016-04-10 Thread mohammed . billoo
From: Mohammed Billoo 

Remove unnecessary comments (highlighting sections of functions), make
multiline comments into single line comments, and ensure that multiline
comments adhere to coding style.

Signed-off-by: Mohammed Billoo 
---
 drivers/staging/wilc1000/wilc_sdio.c | 136 ---
 1 file changed, 31 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
b/drivers/staging/wilc1000/wilc_sdio.c
index a839a79..a082e12 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -1,11 +1,7 @@
-/* // 
*/
-/*  */
-/* Copyright (c) Atmel Corporation.  All rights reserved. */
-/*  */
-/* Module Name:  wilc_sdio.c */
-/*  */
-/*  */
-/* 
 */
+/* Copyright (c) Atmel Corporation.  All rights reserved.
+ *
+ * Module Name:  wilc_sdio.c
+ */
 
 #include 
 #include "wilc_wlan_if.h"
@@ -257,11 +253,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev)
dev_info(&func->dev, "wilc_sdio_disable_interrupt OUT\n");
 }
 
-/
- *
- *  Function 0
- *
- /
 
 static int sdio_set_func0_csa_address(struct wilc *wilc, u32 adr)
 {
@@ -269,9 +260,7 @@ static int sdio_set_func0_csa_address(struct wilc *wilc, 
u32 adr)
struct sdio_cmd52 cmd;
int ret;
 
-   /**
-*  Review: BIG ENDIAN
-**/
+   /* Review: BIG ENDIAN */
cmd.read_write = 1;
cmd.function = 0;
cmd.raw = 0;
@@ -334,11 +323,6 @@ _fail_:
return 0;
 }
 
-/
- *
- *  Function 1
- *
- /
 
 static int sdio_set_func1_block_size(struct wilc *wilc, u32 block_size)
 {
@@ -369,11 +353,7 @@ _fail_:
return 0;
 }
 
-/
- *
- *  Sdio interfaces
- *
- /
+
 static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data)
 {
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
@@ -398,9 +378,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 
data)
} else {
struct sdio_cmd53 cmd;
 
-   /**
-*  set the AHB address
-**/
+   /* set the AHB address */
if (!sdio_set_func0_csa_address(wilc, addr))
goto _fail_;
 
@@ -436,31 +414,23 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 
*buf, u32 size)
 
cmd.read_write = 1;
if (addr > 0) {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 0 access
-**/
+   /* func 0 access */
cmd.function = 0;
cmd.address = 0x10f;
} else {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 1 access
-**/
+   /* func 1 access */
cmd.function = 1;
cmd.address = 0;
}
@@ -576,31 +546,23 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 
*buf, u32 size)
 
cmd.read_write = 0;
if (addr > 0) {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 0 access
-**/
+   /* func 0 access */
cmd.function = 0;
cmd.address = 0x10f;
} else {
-   /**
-*  has to be word aligned...
-**/
+   /* has to be word aligned... */
if (size & 0x3) {
size += 4;
size &= ~0x3;
}
 
-   /**
-*  func 1 access
-**/
+   /* func 1 access */
cmd.function = 1;
cmd.address = 0;
}
@@ -627,7 +589,7 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, 
u32 size)
if (addr > 0)
addr += nblk * bloc