[PATCH 00/16] Fix checkpatch issues in wl_netdev.c

2014-03-17 Thread Jelena Bjelja
This patchset resolves most of checkpatch.pl issues in
wlags49_h2/wl_netdev.c

Jelena Bjelja (16):
  staging: wlags49_h2: Use tabs for indentation
  staging: wlags49_h2: Delete space after open parenthesis
  staging: wlags49_h2 : Delete space before close parenthesis
  staging: wlags49_h2: Add space before parenthesis
  staging: wlags49_h2: Fix C99 style commenting
  staging: wlags49_h2: Enclose macro in a do-while loop
  staging: wlags49_h2: Remove unnecessary braces
  staging: wlags49_h2: Move open brace to a previous line
  staging: wlags49_h2: Fix 'else should follow close brace'
  staging: wlags49_h2: Fix pointer declaration
  staging: wlags49_h2: Add space around '='
  staging: wlags49_h2: Do not use assignment in if condition
  staging: wlags49_h2: Remove space between function name and open
parenthesis
  staging: wlags49_h2: Fix indentation for conditional statement
  staging: wlags49_h2: Fix multi-line commenting
  staging: wlags49_h2: Fix lines over 80 characters

 drivers/staging/wlags49_h2/wl_netdev.c | 2123 
 1 file changed, 1084 insertions(+), 1039 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/16] staging: wlags49_h2: Delete space after open parenthesis

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  628 
 1 file changed, 314 insertions(+), 314 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index d654cd0..4ccac5e 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -133,7 +133,7 @@
desc->BUF_SIZE = len; \
status = hcf_rcv_msg(&(lp->hcfCtx), desc, 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
@@ -158,17 +158,17 @@
  *  errno value otherwise
  *
  
**/
-int wl_init( struct net_device *dev )
+int wl_init(struct net_device *dev )
 {
 //unsigned long   flags;
 //struct wl_private   *lp = wl_priv(dev);
 
-   DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
 
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
-//  wl_lock( lp, &flags );
-//  wl_unlock( lp, &flags );
+//  wl_lock(lp, &flags );
+//  wl_unlock(lp, &flags );
 
return 0;
 } // wl_init
@@ -193,10 +193,10 @@ int wl_init( struct net_device *dev )
  *  errno otherwise
  *
  
**/
-int wl_config( struct net_device *dev, struct ifmap *map )
+int wl_config(struct net_device *dev, struct ifmap *map )
 {
-   DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
-   DBG_PARAM( DbgInfo, "map", "0x%p", map );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   DBG_PARAM(DbgInfo, "map", "0x%p", map );
 
/* The only thing we care about here is a port change. Since this not 
needed,
ignore the request. */
@@ -224,7 +224,7 @@ int wl_config( struct net_device *dev, struct ifmap *map )
  *  statistics.
  *
  
**/
-struct net_device_stats *wl_stats( struct net_device *dev )
+struct net_device_stats *wl_stats(struct net_device *dev )
 {
 #ifdef USE_WDS
int count;
@@ -233,15 +233,15 @@ struct net_device_stats *wl_stats( struct net_device *dev 
)
struct net_device_stats *pStats;
struct wl_private   *lp = wl_priv(dev);
 
-   //DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
 
pStats = NULL;
 
-   wl_lock( lp, &flags );
+   wl_lock(lp, &flags );
 
 #ifdef USE_RTS
-   if( lp->useRTS == 1 ) {
-   wl_unlock( lp, &flags );
+   if(lp->useRTS == 1 ) {
+   wl_unlock(lp, &flags );
return NULL;
}
 #endif  /* USE_RTS */
@@ -249,20 +249,20 @@ struct net_device_stats *wl_stats( struct net_device *dev 
)
 /* Return the statistics for the appropriate device */
 #ifdef USE_WDS
 
-   for( count = 0; count < NUM_WDS_PORTS; count++ ) {
-   if( dev == lp->wds_port[count].dev ) {
-   pStats = &( lp->wds_port[count].stats );
+   for(count = 0; count < NUM_WDS_PORTS; count++ ) {
+   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 ) {
-   pStats = &( lp->stats );
+   if(pStats == NULL ) {
+   pStats = &(lp->stats );
}
 
-   wl_unlock( lp, &flags );
+   wl_unlock(lp, &flags );
 
return pStats;
 } // wl_stats
@@ -292,68 +292,68 @@ int wl_open(struct net_device *dev)
struct wl_private   *lp = wl_priv(dev);
unsigned long   flags;
 
-   wl_lock( lp, &flags );
+   wl_lock(lp, &flags );
 
 #ifdef USE_RTS
-   if( lp->useRTS == 1 ) {
-   DBG_TRACE( DbgInfo, "Skipping device open, in RTS mode\n" );
-   wl_unlock( lp, &flags );
+   if(lp->useRTS == 1 ) {
+   DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n" );
+   wl_unlock(lp, &flags );
   

[PATCH 03/16] staging: wlags49_h2: Delete space before close parenthesis

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  628 
 1 file changed, 314 insertions(+), 314 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 4ccac5e..dc38721 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -133,7 +133,7 @@
desc->BUF_SIZE = len; \
status = hcf_rcv_msg(&(lp->hcfCtx), desc, 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
@@ -158,17 +158,17 @@
  *  errno value otherwise
  *
  
**/
-int wl_init(struct net_device *dev )
+int wl_init(struct net_device *dev)
 {
 //unsigned long   flags;
 //struct wl_private   *lp = wl_priv(dev);
 
-   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
-//  wl_lock(lp, &flags );
-//  wl_unlock(lp, &flags );
+//  wl_lock(lp, &flags);
+//  wl_unlock(lp, &flags);
 
return 0;
 } // wl_init
@@ -193,10 +193,10 @@ int wl_init(struct net_device *dev )
  *  errno otherwise
  *
  
**/
-int wl_config(struct net_device *dev, struct ifmap *map )
+int wl_config(struct net_device *dev, struct ifmap *map)
 {
-   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
-   DBG_PARAM(DbgInfo, "map", "0x%p", map );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+   DBG_PARAM(DbgInfo, "map", "0x%p", map);
 
/* The only thing we care about here is a port change. Since this not 
needed,
ignore the request. */
@@ -224,7 +224,7 @@ int wl_config(struct net_device *dev, struct ifmap *map )
  *  statistics.
  *
  
**/
-struct net_device_stats *wl_stats(struct net_device *dev )
+struct net_device_stats *wl_stats(struct net_device *dev)
 {
 #ifdef USE_WDS
int count;
@@ -233,15 +233,15 @@ struct net_device_stats *wl_stats(struct net_device *dev )
struct net_device_stats *pStats;
struct wl_private   *lp = wl_priv(dev);
 
-   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
pStats = NULL;
 
-   wl_lock(lp, &flags );
+   wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1 ) {
-   wl_unlock(lp, &flags );
+   if(lp->useRTS == 1) {
+   wl_unlock(lp, &flags);
return NULL;
}
 #endif  /* USE_RTS */
@@ -249,20 +249,20 @@ struct net_device_stats *wl_stats(struct net_device *dev )
 /* Return the statistics for the appropriate device */
 #ifdef USE_WDS
 
-   for(count = 0; count < NUM_WDS_PORTS; count++ ) {
-   if(dev == lp->wds_port[count].dev ) {
-   pStats = &(lp->wds_port[count].stats );
+   for(count = 0; count < NUM_WDS_PORTS; count++) {
+   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 ) {
-   pStats = &(lp->stats );
+   if(pStats == NULL) {
+   pStats = &(lp->stats);
}
 
-   wl_unlock(lp, &flags );
+   wl_unlock(lp, &flags);
 
return pStats;
 } // wl_stats
@@ -292,68 +292,68 @@ int wl_open(struct net_device *dev)
struct wl_private   *lp = wl_priv(dev);
unsigned long   flags;
 
-   wl_lock(lp, &flags );
+   wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1 ) {
-   DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n" );
-   wl_unlock(lp, &flags );
+   if(lp->useRTS == 1) {
+   DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n");
+   wl_unlock(lp, &flags);
return -EIO;
}
 #endif  /* USE_RTS */
 
 #ifdef USE_PROF

[PATCH 04/16] staging: wlags49_h2: Add space before parenthesis

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: space required before the open parenthesis '('

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  170 
 1 file changed, 85 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index dc38721..6ab0ff3 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -240,7 +240,7 @@ struct net_device_stats *wl_stats(struct net_device *dev)
wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
wl_unlock(lp, &flags);
return NULL;
}
@@ -249,8 +249,8 @@ struct net_device_stats *wl_stats(struct net_device *dev)
 /* Return the statistics for the appropriate device */
 #ifdef USE_WDS
 
-   for(count = 0; count < NUM_WDS_PORTS; count++) {
-   if(dev == lp->wds_port[count].dev) {
+   for (count = 0; count < NUM_WDS_PORTS; count++) {
+   if (dev == lp->wds_port[count].dev) {
pStats = &(lp->wds_port[count].stats);
}
}
@@ -258,7 +258,7 @@ struct net_device_stats *wl_stats(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);
}
 
@@ -295,7 +295,7 @@ int wl_open(struct net_device *dev)
wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n");
wl_unlock(lp, &flags);
return -EIO;
@@ -306,11 +306,11 @@ int wl_open(struct net_device *dev)
parse_config(dev);
 #endif
 
-   if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+   if (lp->portState == WVLAN_PORT_STATE_DISABLED) {
DBG_TRACE(DbgInfo, "Enabling Port 0\n");
status = wl_enable(lp);
 
-   if(status != HCF_SUCCESS) {
+   if (status != HCF_SUCCESS) {
DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n", 
status);
}
}
@@ -330,7 +330,7 @@ int wl_open(struct net_device *dev)
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
-   if(status != HCF_SUCCESS) {
+   if (status != HCF_SUCCESS) {
// Unsuccessful, try reset of the card to recover
status = wl_reset(dev);
}
@@ -339,7 +339,7 @@ int wl_open(struct net_device *dev)
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
-   if(status == HCF_SUCCESS) {
+   if (status == HCF_SUCCESS) {
netif_carrier_on(dev);
WL_WDS_NETIF_CARRIER_ON(lp);
 
@@ -404,7 +404,7 @@ int wl_close(struct net_device *dev)
lp->is_handling_int = WL_NOT_HANDLING_INT; // Stop handling interrupts
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
DBG_TRACE(DbgInfo, "Skipping device close, in RTS mode\n");
wl_unlock(lp, &flags);
return -EIO;
@@ -479,9 +479,9 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
wl_act_int_off(lp);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
/* Handle any RTS IOCTL here */
-   if(cmd == WL_IOCTL_RTS) {
+   if (cmd == WL_IOCTL_RTS) {
DBG_TRACE(DbgInfo, "IOCTL: WL_IOCTL_RTS\n");
ret = wvlan_rts((struct rtsreq *)rq, dev->base_addr);
} else {
@@ -494,12 +494,12 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, 
int cmd)
 #endif  /* USE_RTS */
 
/* Only handle UIL IOCTL requests when the UIL has the system blocked. 
*/
-   if(!((lp->flags & WVLAN2_UIL_BUSY) && (cmd != WVLAN2_IOCTL_UIL))) {
+   if (!((lp->flags & WVLAN2_UIL_BUSY) && (cmd != WVLAN2_IOCTL_UIL))) {
 #ifdef USE_UIL
struct uilreq  *urq = (struct uilreq *)rq;
 #endif /* USE_UIL */
 
-   switch(cmd) {
+   switch (cmd) {
// == Private IOCTLs (up to 16) ==
 #ifdef USE_UIL
case WVLAN2_IOCTL_UIL:
@@ -573,7 +573,7 @@ void wl_tx_timeout(struct net_device *dev)
wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
DBG_TRACE(DbgInfo, "Skipping tx_timeout handler, in RTS 
mode\n");
wl_unlock(lp, &flags);
return;
@@ -584,8 +584,8 @@ void wl_tx_timeout(struct net_device *dev)
is

[PATCH 05/16] staging: wlags49_h2: Fix C99 style commenting

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: do not use C99 // comments

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  150 
 1 file changed, 75 insertions(+), 75 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 6ab0ff3..6d924c5 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -68,31 +68,31 @@
 #include 
 #include 
 #include 
-// #include 
-// #include 
-// #include 
-// #include 
-// #include 
-//#include 
-// #include 
-// #include 
-// #include 
-// #include 
-// #include 
-// // #include 
+/* #include */
+/* #include*/
+/* #include  */
+/* #include */
+/* #include*/
+/* #include */
+/* #include */
+/* #include*/
+/* #include */
+/* #include*/
+/* #include  */
+/* #include  */
 
 #include 
 #include 
 #include 
-// #include 
-// #include 
-// #include 
+/* #include*/
+/* #include*/
+/* #include*/
 
 #include 
 
 #include 
 #include 
-// #include 
+/* #include  */
 
 #include 
 #include 
@@ -121,9 +121,9 @@
 #define MTU_MAX (HCF_MAX_MSG - ETH_HLEN)
 #endif
 
-//static int mtu = MTU_MAX;
-//MODULE_PARM(mtu, "i");
-//MODULE_PARM_DESC(mtu, "MTU");
+/* static int mtu = MTU_MAX;   */
+/* MODULE_PARM(mtu, "i");  */
+/* MODULE_PARM_DESC(mtu, "MTU");   */
 
 
/***
  * macros
@@ -160,18 +160,18 @@
  
**/
 int wl_init(struct net_device *dev)
 {
-//unsigned long   flags;
-//struct wl_private   *lp = wl_priv(dev);
+/* unsigned long   flags;  */
+/*struct wl_private   *lp = wl_priv(dev);  */
 
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
-//  wl_lock(lp, &flags);
-//  wl_unlock(lp, &flags);
+/*  wl_lock( lp, &flags ); */
+/*  wl_unlock( lp, &flags );   */
 
return 0;
-} // wl_init
+} /* wl_init */
 
/**/
 
 
/***
@@ -203,7 +203,7 @@ int wl_config(struct net_device *dev, struct ifmap *map)
DBG_TRACE(DbgInfo, "%s: %s called.\n", dev->name, __func__);
 
return 0;
-} // wl_config
+} /* wl_config */
 
/**/
 
 
/***
@@ -233,7 +233,7 @@ struct net_device_stats *wl_stats(struct net_device *dev)
struct net_device_stats *pStats;
struct wl_private   *lp = wl_priv(dev);
 
-   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+   /* DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); */
 
pStats = NULL;
 
@@ -265,7 +265,7 @@ struct net_device_stats *wl_stats(struct net_device *dev)
wl_unlock(lp, &flags);
 
return pStats;
-} // wl_stats
+} /* wl_stats */
 
/**/
 
 
/***
@@ -315,7 +315,7 @@ int wl_open(struct net_device *dev)
}
}
 
-   // Holding the lock too long, make a gap to allow other processes
+   /* Holding the lock too long, make a gap to allow other processes */
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
@@ -326,16 +326,16 @@ int wl_open(struct net_device *dev)
status = wl_apply(lp);
}
 
-   // Holding the lock too long, make a gap to allow other processes
+   /* Holding the lock too long, make a gap to allow other processes */
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
if (status != HCF_SUCCESS) {
-   // Unsuccessful, try reset of the card to recover
+   /* Unsuccessful, try reset of the card to recover */
status = wl_reset(dev);
}
 
-   // Holding the lock too long, make a gap to allow other processes
+   /* Holding the lock too long, make a gap to allow other processes */
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
@@ -343,7 +343,7 @@ int wl_open(struct net_device *dev)
netif_carrier_on(dev);
WL_WDS_NETIF_CARRIER_ON(lp);
 
-   lp->is_handling_int = WL_HANDLING_INT; // Start handling 
interrupts
+   lp->is_handling_int = WL_HANDLING_INT; /* Start handling 
interrupts */
   

[PATCH 06/16] staging: wlags49_h2: Enclose macro in a do-while loop

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: Macros with multiple statements should be enclosed in a do -
while loop

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 6d924c5..0ac4432 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -129,9 +129,11 @@
  * macros
  
**/
 #define BLOCK_INPUT(buf, len) \
-   desc->buf_addr = buf; \
-   desc->BUF_SIZE = len; \
-   status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
+   do { \
+   desc->buf_addr = buf; \
+   desc->BUF_SIZE = len; \
+   status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0); \
+   } while (0)
 
 #define BLOCK_INPUT_DMA(buf, len) memcpy(buf, desc_next->buf_addr, pktlen)
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/16] staging: wlags49_h2: Do not use assignment in if condition

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issue in wl_netdev.c:
ERROR: do not use assignment in if condition

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index e1661ff..d6cd00a 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1774,7 +1774,9 @@ int wl_rx_dma(struct net_device *dev)
 
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
-   if (((lp = dev->priv) != NULL) &&
+   lp = dev->priv;
+
+   if ((lp != NULL) &&
!(lp->flags & WVLAN2_UIL_BUSY)) {
 
 #ifdef USE_RTS
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/16] staging: wlags49_h2: Remove space between function name and open parenthesis

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issue in wl_netdev.c:
WARNING: space prohibited between function name and open parenthesis

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index d6cd00a..a1cabd2 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1697,7 +1697,7 @@ int wl_send_dma(struct wl_private *lp, struct sk_buff 
*skb, int port)
/* AGAIN, ALL THE QUEUEING DONE HERE IN I/O MODE IS NOT PERFORMED */
 
if (skb == NULL) {
-   DBG_WARNING (DbgInfo, "Nothing to send.\n");
+   DBG_WARNING(DbgInfo, "Nothing to send.\n");
return FALSE;
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/16] staging: wlags49_h2: Fix indentation for conditional statement

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
WARNING: suspect code indent for conditional statements

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   56 
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index a1cabd2..9fb12f3 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -330,8 +330,8 @@ int wl_open(struct net_device *dev)
wl_lock(lp, &flags);
 
if (status != HCF_SUCCESS) {
-   /* Unsuccessful, try reset of the card to recover */
-   status = wl_reset(dev);
+   /* Unsuccessful, try reset of the card to recover */
+   status = wl_reset(dev);
}
 
/* Holding the lock too long, make a gap to allow other processes */
@@ -479,7 +479,7 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
 
 #ifdef USE_RTS
if (lp->useRTS == 1) {
-   /* Handle any RTS IOCTL here */
+   /* Handle any RTS IOCTL here */
if (cmd == WL_IOCTL_RTS) {
DBG_TRACE(DbgInfo, "IOCTL: WL_IOCTL_RTS\n");
ret = wvlan_rts((struct rtsreq *)rq, dev->base_addr);
@@ -869,7 +869,7 @@ int wl_rx(struct net_device *dev)
if (pktlen != 0) {
skb = ALLOC_SKB(pktlen);
if (skb != NULL) {
-   /* Set the netdev based on the port */
+   /* Set the netdev based on the port */
switch (port) {
 #ifdef USE_WDS
case 1:
@@ -1016,7 +1016,7 @@ void wl_multicast(struct net_device *dev)
 
if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == 
COMP_ID_FW_STA) {
if (dev->flags & IFF_PROMISC) {
-   /* Enable promiscuous mode */
+   /* Enable promiscuous mode */
lp->ltvRecord.len   = 2;
lp->ltvRecord.typ   = CFG_PROMISCUOUS_MODE;
lp->ltvRecord.u.u16[0]  = CNV_INT_TO_LITTLE(1);
@@ -1024,9 +1024,9 @@ void wl_multicast(struct net_device *dev)
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
} else if ((netdev_mc_count(dev) > HCF_MAX_MULTICAST) ||
(dev->flags & IFF_ALLMULTI)) {
-   /* Shutting off this filter will enable all multicast 
frames to
-   be sent up from the device; however, this is a static 
RID, so
-   a call to wl_apply() is needed */
+   /* Shutting off this filter will enable all 
multicast frames to
+   be sent up from the device; however, this is a 
static RID, so
+   a call to wl_apply() is needed */
lp->ltvRecord.len   = 2;
lp->ltvRecord.typ   = 
CFG_CNF_RX_ALL_GROUP_ADDR;
lp->ltvRecord.u.u16[0]  = CNV_INT_TO_LITTLE(0);
@@ -1034,7 +1034,7 @@ void wl_multicast(struct net_device *dev)
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
wl_apply(lp);
} else if (!netdev_mc_empty(dev)) {
-   /* Set the multicast addresses */
+   /* Set the multicast addresses */
lp->ltvRecord.len = (netdev_mc_count(dev) * 3) 
+ 1;
lp->ltvRecord.typ = CFG_GROUP_ADDR;
 
@@ -1791,25 +1791,25 @@ int wl_rx_dma(struct net_device *dev)
desc = hcf_dma_rx_get(&(lp->hcfCtx));
 
if (desc != NULL) {
-/* Check and see if we rcvd. a WMP frame */
-/*
-   if (((*(hcf_8 *)&desc->buf_addr[HFS_STAT]) &
-   (HFS_STAT_MSG_TYPE | HFS_STAT_ERR)) == HFS_STAT_WMP_MSG)
-   {
-   DBG_TRACE(DbgInfo, "Got a WMP frame\n");
-
-   x.len = sizeof(CFG_MB_INFO_RANGE2_STRCT) / 
sizeof(hcf_16);
-   x.typ = CFG_MB_INFO;
-   x.base_typ = CFG_WMP;
-   x.frag_cnt = 2;
-   x.frag_buf[0].frag_len  = GET_BUF_CNT(descp) / 
sizeof(hcf_16);
-   x.frag_buf[0].frag_addr = (hcf_8 *) descp->buf_addr ;
-   x.frag_buf[1].frag_len  = 
(GET_BUF_CNT(descp->next_desc_addr) + 1) / sizeof(hcf_16);
-   x.frag_buf[1].frag_addr = (hcf_8 *) 
descp->next_desc_addr->buf_addr ;
-

[PATCH 08/16] staging: wlags49_h2: Move open brace to a previous line

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: that open brace { should be on the previous line

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 4b81ecc..e3aa90e 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -701,8 +701,7 @@ int wl_send(struct wl_private *lp)
}
 
 #ifdef USE_WDS
-   else
-   {
+   else {
lp->wds_port[((lp->txF.port >> 8) - 
1)].stats.tx_packets++;
lp->wds_port[((lp->txF.port >> 8) - 1)].stats.tx_bytes 
+= lp->txF.skb->len;
}
@@ -910,8 +909,7 @@ int wl_rx(struct net_device *dev)
lp->stats.rx_bytes += pktlen;
}
 #ifdef USE_WDS
-   else
-   {
+   else {

lp->wds_port[port-1].stats.rx_packets++;

lp->wds_port[port-1].stats.rx_bytes += pktlen;
}
@@ -1095,8 +1093,7 @@ void wl_multicast(struct net_device *dev, int num_addrs, 
void *addrs)
 
 #endif /* NEW_MULTICAST */
 
-static const struct net_device_ops wl_netdev_ops =
-{
+static const struct net_device_ops wl_netdev_ops = {
.ndo_start_xmit = &wl_tx_port0,
 
.ndo_set_config = &wl_config,
@@ -1150,8 +1147,7 @@ struct net_device * wl_device_alloc(void)
 
 
/* Check MTU */
-   if (dev->mtu > MTU_MAX)
-   {
+   if (dev->mtu > MTU_MAX) {
DBG_WARNING(DbgInfo, "%s: MTU set too high, limiting to %d.\n",
dev->name, MTU_MAX);
dev->mtu = MTU_MAX;
@@ -1795,8 +1791,7 @@ int wl_rx_dma(struct net_device *dev)
/* { */
desc = hcf_dma_rx_get(&(lp->hcfCtx));
 
-   if (desc != NULL)
-   {
+   if (desc != NULL) {
 /* Check and see if we rcvd. a WMP frame */
 /*
if (((*(hcf_8 *)&desc->buf_addr[HFS_STAT]) &
@@ -1831,8 +1826,7 @@ int wl_rx_dma(struct net_device *dev)
hfs_stat = (hcf_16)(desc->buf_addr[HFS_STAT/2]);
 
/* Make sure the frame isn't bad */
-   if ((hfs_stat & HFS_STAT_ERR) != HCF_SUCCESS)
-   {
+   if ((hfs_stat & HFS_STAT_ERR) != HCF_SUCCESS) {
DBG_WARNING(DbgInfo, "HFS_STAT_ERROR (0x%x) in 
Rx Packet\n",
desc->buf_addr[HFS_STAT/2]);
 
@@ -1879,8 +1873,7 @@ int wl_rx_dma(struct net_device *dev)
lp->stats.rx_bytes += pktlen;
}
 #ifdef USE_WDS
-   else
-   {
+   else {

lp->wds_port[port-1].stats.rx_packets++;

lp->wds_port[port-1].stats.rx_bytes += pktlen;
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/16] staging: wlags49_h2: Fix pointer declaration

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issue in wl_netdev.c:
ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index def8370..0d3c474 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1128,7 +1128,7 @@ static const struct net_device_ops wl_netdev_ops = {
  *  device.
  *
  
**/
-struct net_device * wl_device_alloc(void)
+struct net_device *wl_device_alloc(void)
 {
struct net_device   *dev = NULL;
struct wl_private   *lp = NULL;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 15/16] staging: wlags49_h2: Fix multi-line commenting

2014-03-17 Thread Jelena Bjelja
This patch adjusts multi-line comments to “net/” kernel coding style in
wl_netdev.c, since the driver depends on WLAN.

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  351 ++--
 1 file changed, 203 insertions(+), 148 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 9fb12f3..eaff3b7 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1,4 +1,4 @@
-/***
+/* 
*
  * Agere Systems Inc.
  * Wireless device driver for Linux (wlags49).
  *
@@ -57,11 +57,13 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  * DAMAGE.
  *
- 
**/
+ * 
*
+ */
 
-/***
+/* 
*
  * include files
- 
**/
+ * 
*
+ */
 #include 
 
 #include 
@@ -125,9 +127,10 @@
 /* MODULE_PARM(mtu, "i");  */
 /* MODULE_PARM_DESC(mtu, "MTU");   */
 
-/***
+/* 
*
  * macros
- 
**/
+ * 
*
+ */
 #define BLOCK_INPUT(buf, len) \
do { \
desc->buf_addr = buf; \
@@ -137,13 +140,14 @@
 
 #define BLOCK_INPUT_DMA(buf, len) memcpy(buf, desc_next->buf_addr, pktlen)
 
-/***
+/* 
*
  * function prototypes
- 
**/
+ * 
*
+ */
 
-/***
+/* 
*
  * wl_init()
- 
***
+ * 
*
  *
  *  DESCRIPTION:
  *
@@ -159,7 +163,8 @@
  *  0 on success
  *  errno value otherwise
  *
- 
**/
+ * 
*
+ */
 int wl_init(struct net_device *dev)
 {
 /* unsigned long   flags;  */
@@ -176,9 +181,9 @@ int wl_init(struct net_device *dev)
 } /* wl_init */
 
/**/
 
-/***
+/* 
*
  * wl_config()
- 
***
+ * 
*
  *
  *  DESCRIPTION:
  *
@@ -194,7 +199,8 @@ int wl_init(struct net_device *dev)
  *  0 on success
  *  errno otherwise
  *
- 
**/
+ * 
*
+ */
 int wl_config(struct net_device *dev, struct ifmap *map)
 {
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
@@ -208,9 +214,9 @@ int wl_config(struct net_device *dev, struct ifmap *map)
 } /* wl_config */
 
/**/
 
-/***
+/* 
*
  * wl_stats()
- 
***
+ * 
*
  *
  *  DESCRIPTION:
  *
@@ -225,7 +231,8 @@ int wl_config(struct net_device *dev, struct ifmap *map)
  *  a pointer to a net_device_stats structure containing the network
  *  statistics.
  *
- 
**/
+ * 
*

[PATCH 07/16] staging: wlags49_h2: Remove unnecessary braces

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   35 
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 0ac4432..4b81ecc 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -252,17 +252,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);
 
@@ -312,9 +310,8 @@ int wl_open(struct net_device *dev)
DBG_TRACE(DbgInfo, "Enabling Port 0\n");
status = wl_enable(lp);
 
-   if (status != HCF_SUCCESS) {
+   if (status != HCF_SUCCESS)
DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n", 
status);
-   }
}
 
/* Holding the lock too long, make a gap to allow other processes */
@@ -599,9 +596,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++;
@@ -649,9 +645,8 @@ int wl_send(struct wl_private *lp)
 
/* Check for the availability of FIDs; if none are available, don't 
take any
frames off the txQ */
-   if (lp->hcfCtx.IFB_RscInd == 0) {
+   if (lp->hcfCtx.IFB_RscInd == 0)
return FALSE;
-   }
 
/* Reclaim the TxQ Elements and place them back on the free queue */
if (!list_empty(&(lp->txQ[0]))) {
@@ -681,9 +676,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 */
@@ -937,14 +931,11 @@ int wl_rx(struct net_device *dev)
} else {
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-1].stats.rx_dropped++;
-   }
 #endif  /* USE_WDS */
 
dev_kfree_skb(skb);
@@ -952,14 +943,11 @@ 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-1].stats.rx_dropped++;
-   }
 #endif  /* USE_WDS */
}
}
@@ -1634,9 +1622,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 */
@@ -1905,14 +1892,10 @@ int wl_rx_dma(struct net_device *dev)
DBG_ERROR(DbgInfo, "Could not alloc 
skb\n");
 
if (port == 0)
-   {
   

[PATCH 09/16] staging: wlags49_h2: Fix 'else should follow close brace'

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issues in wl_netdev.c:
ERROR: else should follow close brace '}'

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index e3aa90e..def8370 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -797,8 +797,7 @@ int wl_tx(struct sk_buff *skb, struct net_device *dev, int 
port)
 #ifdef ENABLE_DMA
if (lp->use_dma) {
wl_send_dma(lp, skb, port);
-   }
-   else
+   } else
 #endif
{
wl_send(lp);
@@ -1023,8 +1022,7 @@ void wl_multicast(struct net_device *dev)
lp->ltvRecord.u.u16[0]  = CNV_INT_TO_LITTLE(1);
DBG_PRINT("Enabling Promiscuous mode 
(IFF_PROMISC)\n");
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
-   }
-   else if ((netdev_mc_count(dev) > HCF_MAX_MULTICAST) ||
+   } else if ((netdev_mc_count(dev) > HCF_MAX_MULTICAST) ||
(dev->flags & IFF_ALLMULTI)) {
/* Shutting off this filter will enable all multicast 
frames to
be sent up from the device; however, this is a static 
RID, so
@@ -1035,8 +1033,7 @@ void wl_multicast(struct net_device *dev)
DBG_PRINT("Enabling all multicast mode 
(IFF_ALLMULTI)\n");
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
wl_apply(lp);
-   }
-   else if (!netdev_mc_empty(dev)) {
+   } else if (!netdev_mc_empty(dev)) {
/* Set the multicast addresses */
lp->ltvRecord.len = (netdev_mc_count(dev) * 3) 
+ 1;
lp->ltvRecord.typ = CFG_GROUP_ADDR;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/16] staging: wlags49_h2: Add space around '='

2014-03-17 Thread Jelena Bjelja
This patch fixes the following checkpatch.pl issue in wl_netdev.c:
ERROR: spaces required around that '=' 

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 0d3c474..e1661ff 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -878,7 +878,7 @@ int wl_rx(struct net_device *dev)
case 4:
case 5:
case 6:
-   skb->dev =lp->wds_port[port-1].dev;
+   skb->dev = lp->wds_port[port-1].dev;
break;
 #endif  /* USE_WDS */
case 0:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 16/16] staging: wlags49_h2: Fix lines over 80 characters

2014-03-17 Thread Jelena Bjelja
This patch fixes some lines that exceed 80 characters in  wl_netdev.c
WARNING: line over 80 characters

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   62 +++-
 1 file changed, 38 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index eaff3b7..5bff0f3 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -206,8 +206,9 @@ int wl_config(struct net_device *dev, struct ifmap *map)
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
DBG_PARAM(DbgInfo, "map", "0x%p", map);
 
-   /* The only thing we care about here is a port change. Since this not 
needed,
-   ignore the request. */
+   /* The only thing we care about here is a port change.
+* Since this is not needed, ignore the request.
+*/
DBG_TRACE(DbgInfo, "%s: %s called.\n", dev->name, __func__);
 
return 0;
@@ -319,7 +320,8 @@ int wl_open(struct net_device *dev)
status = wl_enable(lp);
 
if (status != HCF_SUCCESS)
-   DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n", 
status);
+   DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n",
+   status);
}
 
/* Holding the lock too long, make a gap to allow other processes */
@@ -350,14 +352,15 @@ int wl_open(struct net_device *dev)
netif_carrier_on(dev);
WL_WDS_NETIF_CARRIER_ON(lp);
 
-   lp->is_handling_int = WL_HANDLING_INT; /* Start handling 
interrupts */
+   /* Start handling interrupts */
+   lp->is_handling_int = WL_HANDLING_INT;
wl_act_int_on(lp);
 
netif_start_queue(dev);
WL_WDS_NETIF_START_QUEUE(lp);
} else {
-   wl_hcf_error(dev, status);  /* Report the error */
-   netif_device_detach(dev);   /* Stop the device and 
queue */
+   wl_hcf_error(dev, status);  /* Report the error */
+   netif_device_detach(dev);   /* Stop the device and queue */
}
 
wl_unlock(lp, &flags);
@@ -409,7 +412,8 @@ int wl_close(struct net_device *dev)
wl_lock(lp, &flags);
 
wl_act_int_off(lp);
-   lp->is_handling_int = WL_NOT_HANDLING_INT; /* Stop handling interrupts 
*/
+   /* Stop handling interrupts */
+   lp->is_handling_int = WL_NOT_HANDLING_INT;
 
 #ifdef USE_RTS
if (lp->useRTS == 1) {
@@ -494,7 +498,8 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
DBG_TRACE(DbgInfo, "IOCTL: WL_IOCTL_RTS\n");
ret = wvlan_rts((struct rtsreq *)rq, dev->base_addr);
} else {
-   DBG_TRACE(DbgInfo, "IOCTL not supported in RTS mode: 
0x%X\n", cmd);
+   DBG_TRACE(DbgInfo,
+   "IOCTL not supported in RTS mode: 0x%X\n", cmd);
ret = -EOPNOTSUPP;
}
 
@@ -502,7 +507,7 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
}
 #endif  /* USE_RTS */
 
-   /* Only handle UIL IOCTL requests when the UIL has the system blocked. 
*/
+   /* Only handle UIL IOCTL requests when the UIL has the system blocked */
if (!((lp->flags & WVLAN2_UIL_BUSY) && (cmd != WVLAN2_IOCTL_UIL))) {
 #ifdef USE_UIL
struct uilreq  *urq = (struct uilreq *)rq;
@@ -518,12 +523,14 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, 
int cmd)
 #endif  /* USE_UIL */
 
default:
-   DBG_TRACE(DbgInfo, "IOCTL CODE NOT SUPPORTED: 0x%X\n", 
cmd);
+   DBG_TRACE(DbgInfo,
+   "IOCTL CODE NOT SUPPORTED: 0x%X\n", cmd);
ret = -EOPNOTSUPP;
break;
}
} else {
-   DBG_WARNING(DbgInfo, "DEVICE IS BUSY, CANNOT PROCESS 
REQUEST\n");
+   DBG_WARNING(DbgInfo,
+   "DEVICE IS BUSY, CANNOT PROCESS REQUEST\n");
ret = -EBUSY;
}
 
@@ -584,7 +591,8 @@ void wl_tx_timeout(struct net_device *dev)
 
 #ifdef USE_RTS
if (lp->useRTS == 1) {
-   DBG_TRACE(DbgInfo, "Skipping tx_timeout handler, in RTS 
mode\n");
+   DBG_TRACE(DbgInfo,
+   "Skipping tx_timeout handler, in RTS mode\n");
wl_unlock(lp

[PATCH v2 00/16] staging: wlags49_h2: Fix checkpatch issues in wl_netdev.c

2014-03-18 Thread Jelena Bjelja
This patchset fixes most of the checkpatch.pl issues in wl_netdev.c

Changes in v2:
* Delete unnecessary line added in a previous version (v1) of the patch:
staging: wlags49_h2: Do not use assignment in if condition
noted by Julia Lawall 

* Use imperative form in a commit log

Jelena Bjelja (16):
  staging: wlags49_h2: Use tabs for indentation
  staging: wlags49_h2: Delete space after open parenthesis
  staging: wlags49_h2 : Delete space before close parenthesis
  staging: wlags49_h2: Add space before parenthesis
  staging: wlags49_h2: Fix C99 style commenting
  staging: wlags49_h2: Enclose macro in a do-while loop
  staging: wlags49_h2: Remove unnecessary braces
  staging: wlags49_h2: Move open brace to a previous line
  staging: wlags49_h2: Fix 'else should follow close brace'
  staging: wlags49_h2: Fix pointer declaration
  staging: wlags49_h2: Add space around '='
  staging: wlags49_h2: Do not use assignment in if condition
  staging: wlags49_h2: Remove space between function name and open
parenthesis
  staging: wlags49_h2: Fix indentation for conditional statement
  staging: wlags49_h2: Fix multi-line commenting
  staging: wlags49_h2: Fix lines over 80 characters

 drivers/staging/wlags49_h2/wl_netdev.c | 2122 
 1 file changed, 1083 insertions(+), 1039 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 03/16] staging: wlags49_h2: Delete space before close parenthesis

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  628 
 1 file changed, 314 insertions(+), 314 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index a8672db..f5995d4 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -133,7 +133,7 @@
desc->BUF_SIZE = len; \
status = hcf_rcv_msg(&(lp->hcfCtx), desc, 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
@@ -158,17 +158,17 @@
  *  errno value otherwise
  *
  
**/
-int wl_init(struct net_device *dev )
+int wl_init(struct net_device *dev)
 {
 //unsigned long   flags;
 //struct wl_private   *lp = wl_priv(dev);
 
-   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
-//  wl_lock(lp, &flags );
-//  wl_unlock(lp, &flags );
+//  wl_lock(lp, &flags);
+//  wl_unlock(lp, &flags);
 
return 0;
 } // wl_init
@@ -193,10 +193,10 @@ int wl_init(struct net_device *dev )
  *  errno otherwise
  *
  
**/
-int wl_config(struct net_device *dev, struct ifmap *map )
+int wl_config(struct net_device *dev, struct ifmap *map)
 {
-   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
-   DBG_PARAM(DbgInfo, "map", "0x%p", map );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+   DBG_PARAM(DbgInfo, "map", "0x%p", map);
 
/* The only thing we care about here is a port change. Since this not 
needed,
ignore the request. */
@@ -224,7 +224,7 @@ int wl_config(struct net_device *dev, struct ifmap *map )
  *  statistics.
  *
  
**/
-struct net_device_stats *wl_stats(struct net_device *dev )
+struct net_device_stats *wl_stats(struct net_device *dev)
 {
 #ifdef USE_WDS
int count;
@@ -233,15 +233,15 @@ struct net_device_stats *wl_stats(struct net_device *dev )
struct net_device_stats *pStats;
struct wl_private   *lp = wl_priv(dev);
 
-   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
pStats = NULL;
 
-   wl_lock(lp, &flags );
+   wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1 ) {
-   wl_unlock(lp, &flags );
+   if(lp->useRTS == 1) {
+   wl_unlock(lp, &flags);
return NULL;
}
 #endif  /* USE_RTS */
@@ -249,20 +249,20 @@ struct net_device_stats *wl_stats(struct net_device *dev )
 /* Return the statistics for the appropriate device */
 #ifdef USE_WDS
 
-   for(count = 0; count < NUM_WDS_PORTS; count++ ) {
-   if(dev == lp->wds_port[count].dev ) {
-   pStats = &(lp->wds_port[count].stats );
+   for(count = 0; count < NUM_WDS_PORTS; count++) {
+   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 ) {
-   pStats = &(lp->stats );
+   if(pStats == NULL) {
+   pStats = &(lp->stats);
}
 
-   wl_unlock(lp, &flags );
+   wl_unlock(lp, &flags);
 
return pStats;
 } // wl_stats
@@ -292,68 +292,68 @@ int wl_open(struct net_device *dev)
struct wl_private   *lp = wl_priv(dev);
unsigned long   flags;
 
-   wl_lock(lp, &flags );
+   wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1 ) {
-   DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n" );
-   wl_unlock(lp, &flags );
+   if(lp->useRTS == 1) {
+   DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n");
+   wl_unlock(lp, &flags);
return -EIO;
}
 #endif  /* USE_RTS */
 
 #ifdef USE_PROFILE

[PATCH v2 02/16] staging: wlags49_h2: Delete space after open parenthesis

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  628 
 1 file changed, 314 insertions(+), 314 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 128e6a2..a8672db 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -133,7 +133,7 @@
desc->BUF_SIZE = len; \
status = hcf_rcv_msg(&(lp->hcfCtx), desc, 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
@@ -158,17 +158,17 @@
  *  errno value otherwise
  *
  
**/
-int wl_init( struct net_device *dev )
+int wl_init(struct net_device *dev )
 {
 //unsigned long   flags;
 //struct wl_private   *lp = wl_priv(dev);
 
-   DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
 
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
-//  wl_lock( lp, &flags );
-//  wl_unlock( lp, &flags );
+//  wl_lock(lp, &flags );
+//  wl_unlock(lp, &flags );
 
return 0;
 } // wl_init
@@ -193,10 +193,10 @@ int wl_init( struct net_device *dev )
  *  errno otherwise
  *
  
**/
-int wl_config( struct net_device *dev, struct ifmap *map )
+int wl_config(struct net_device *dev, struct ifmap *map )
 {
-   DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
-   DBG_PARAM( DbgInfo, "map", "0x%p", map );
+   DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   DBG_PARAM(DbgInfo, "map", "0x%p", map );
 
/* The only thing we care about here is a port change. Since this not 
needed,
ignore the request. */
@@ -224,7 +224,7 @@ int wl_config( struct net_device *dev, struct ifmap *map )
  *  statistics.
  *
  
**/
-struct net_device_stats *wl_stats( struct net_device *dev )
+struct net_device_stats *wl_stats(struct net_device *dev )
 {
 #ifdef USE_WDS
int count;
@@ -233,15 +233,15 @@ struct net_device_stats *wl_stats( struct net_device *dev 
)
struct net_device_stats *pStats;
struct wl_private   *lp = wl_priv(dev);
 
-   //DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
 
pStats = NULL;
 
-   wl_lock( lp, &flags );
+   wl_lock(lp, &flags );
 
 #ifdef USE_RTS
-   if( lp->useRTS == 1 ) {
-   wl_unlock( lp, &flags );
+   if(lp->useRTS == 1 ) {
+   wl_unlock(lp, &flags );
return NULL;
}
 #endif  /* USE_RTS */
@@ -249,20 +249,20 @@ struct net_device_stats *wl_stats( struct net_device *dev 
)
 /* Return the statistics for the appropriate device */
 #ifdef USE_WDS
 
-   for( count = 0; count < NUM_WDS_PORTS; count++ ) {
-   if( dev == lp->wds_port[count].dev ) {
-   pStats = &( lp->wds_port[count].stats );
+   for(count = 0; count < NUM_WDS_PORTS; count++ ) {
+   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 ) {
-   pStats = &( lp->stats );
+   if(pStats == NULL ) {
+   pStats = &(lp->stats );
}
 
-   wl_unlock( lp, &flags );
+   wl_unlock(lp, &flags );
 
return pStats;
 } // wl_stats
@@ -292,68 +292,68 @@ int wl_open(struct net_device *dev)
struct wl_private   *lp = wl_priv(dev);
unsigned long   flags;
 
-   wl_lock( lp, &flags );
+   wl_lock(lp, &flags );
 
 #ifdef USE_RTS
-   if( lp->useRTS == 1 ) {
-   DBG_TRACE( DbgInfo, "Skipping device open, in RTS mode\n" );
-   wl_unlock( lp, &flags );
+   if(lp->useRTS == 1 ) {
+   DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n" );
+   wl_unlock(lp, &flags );
return -EIO;
   

[PATCH v2 06/16] staging: wlags49_h2: Enclose macro in a do-while loop

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: Macros with multiple statements should be enclosed in a do -
while loop

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index cc226a6..810712e 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -129,9 +129,11 @@
  * macros
  
**/
 #define BLOCK_INPUT(buf, len) \
-   desc->buf_addr = buf; \
-   desc->BUF_SIZE = len; \
-   status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
+   do { \
+   desc->buf_addr = buf; \
+   desc->BUF_SIZE = len; \
+   status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0); \
+   } while (0)
 
 #define BLOCK_INPUT_DMA(buf, len) memcpy(buf, desc_next->buf_addr, pktlen)
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 07/16] staging: wlags49_h2: Remove unnecessary braces

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   35 
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 810712e..f18c04d 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -252,17 +252,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);
 
@@ -312,9 +310,8 @@ int wl_open(struct net_device *dev)
DBG_TRACE(DbgInfo, "Enabling Port 0\n");
status = wl_enable(lp);
 
-   if (status != HCF_SUCCESS) {
+   if (status != HCF_SUCCESS)
DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n", 
status);
-   }
}
 
/* Holding the lock too long, make a gap to allow other processes */
@@ -599,9 +596,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++;
@@ -649,9 +645,8 @@ int wl_send(struct wl_private *lp)
 
/* Check for the availability of FIDs; if none are available, don't 
take any
frames off the txQ */
-   if (lp->hcfCtx.IFB_RscInd == 0) {
+   if (lp->hcfCtx.IFB_RscInd == 0)
return FALSE;
-   }
 
/* Reclaim the TxQ Elements and place them back on the free queue */
if (!list_empty(&(lp->txQ[0]))) {
@@ -681,9 +676,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 */
@@ -937,14 +931,11 @@ int wl_rx(struct net_device *dev)
} else {
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-1].stats.rx_dropped++;
-   }
 #endif  /* USE_WDS */
 
dev_kfree_skb(skb);
@@ -952,14 +943,11 @@ 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-1].stats.rx_dropped++;
-   }
 #endif  /* USE_WDS */
}
}
@@ -1634,9 +1622,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 */
@@ -1905,14 +1892,10 @@ int wl_rx_dma(struct net_device *dev)
DBG_ERROR(DbgInfo, "Could not alloc 
skb\n");
 
if (port == 0)
-   {
   

[PATCH v2 09/16] staging: wlags49_h2: Fix 'else should follow close brace'

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: else should follow close brace '}'

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 0a5b2b3..d79a166 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -797,8 +797,7 @@ int wl_tx(struct sk_buff *skb, struct net_device *dev, int 
port)
 #ifdef ENABLE_DMA
if (lp->use_dma) {
wl_send_dma(lp, skb, port);
-   }
-   else
+   } else
 #endif
{
wl_send(lp);
@@ -1023,8 +1022,7 @@ void wl_multicast(struct net_device *dev)
lp->ltvRecord.u.u16[0]  = CNV_INT_TO_LITTLE(1);
DBG_PRINT("Enabling Promiscuous mode 
(IFF_PROMISC)\n");
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
-   }
-   else if ((netdev_mc_count(dev) > HCF_MAX_MULTICAST) ||
+   } else if ((netdev_mc_count(dev) > HCF_MAX_MULTICAST) ||
(dev->flags & IFF_ALLMULTI)) {
/* Shutting off this filter will enable all multicast 
frames to
be sent up from the device; however, this is a static 
RID, so
@@ -1035,8 +1033,7 @@ void wl_multicast(struct net_device *dev)
DBG_PRINT("Enabling all multicast mode 
(IFF_ALLMULTI)\n");
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
wl_apply(lp);
-   }
-   else if (!netdev_mc_empty(dev)) {
+   } else if (!netdev_mc_empty(dev)) {
/* Set the multicast addresses */
lp->ltvRecord.len = (netdev_mc_count(dev) * 3) 
+ 1;
lp->ltvRecord.typ = CFG_GROUP_ADDR;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 08/16] staging: wlags49_h2: Move open brace to a previous line

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: that open brace { should be on the previous line

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index f18c04d..0a5b2b3 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -701,8 +701,7 @@ int wl_send(struct wl_private *lp)
}
 
 #ifdef USE_WDS
-   else
-   {
+   else {
lp->wds_port[((lp->txF.port >> 8) - 
1)].stats.tx_packets++;
lp->wds_port[((lp->txF.port >> 8) - 1)].stats.tx_bytes 
+= lp->txF.skb->len;
}
@@ -910,8 +909,7 @@ int wl_rx(struct net_device *dev)
lp->stats.rx_bytes += pktlen;
}
 #ifdef USE_WDS
-   else
-   {
+   else {

lp->wds_port[port-1].stats.rx_packets++;

lp->wds_port[port-1].stats.rx_bytes += pktlen;
}
@@ -1095,8 +1093,7 @@ void wl_multicast(struct net_device *dev, int num_addrs, 
void *addrs)
 
 #endif /* NEW_MULTICAST */
 
-static const struct net_device_ops wl_netdev_ops =
-{
+static const struct net_device_ops wl_netdev_ops = {
.ndo_start_xmit = &wl_tx_port0,
 
.ndo_set_config = &wl_config,
@@ -1150,8 +1147,7 @@ struct net_device * wl_device_alloc(void)
 
 
/* Check MTU */
-   if (dev->mtu > MTU_MAX)
-   {
+   if (dev->mtu > MTU_MAX) {
DBG_WARNING(DbgInfo, "%s: MTU set too high, limiting to %d.\n",
dev->name, MTU_MAX);
dev->mtu = MTU_MAX;
@@ -1795,8 +1791,7 @@ int wl_rx_dma(struct net_device *dev)
/* { */
desc = hcf_dma_rx_get(&(lp->hcfCtx));
 
-   if (desc != NULL)
-   {
+   if (desc != NULL) {
 /* Check and see if we rcvd. a WMP frame */
 /*
if (((*(hcf_8 *)&desc->buf_addr[HFS_STAT]) &
@@ -1831,8 +1826,7 @@ int wl_rx_dma(struct net_device *dev)
hfs_stat = (hcf_16)(desc->buf_addr[HFS_STAT/2]);
 
/* Make sure the frame isn't bad */
-   if ((hfs_stat & HFS_STAT_ERR) != HCF_SUCCESS)
-   {
+   if ((hfs_stat & HFS_STAT_ERR) != HCF_SUCCESS) {
DBG_WARNING(DbgInfo, "HFS_STAT_ERROR (0x%x) in 
Rx Packet\n",
desc->buf_addr[HFS_STAT/2]);
 
@@ -1879,8 +1873,7 @@ int wl_rx_dma(struct net_device *dev)
lp->stats.rx_bytes += pktlen;
}
 #ifdef USE_WDS
-   else
-   {
+   else {

lp->wds_port[port-1].stats.rx_packets++;

lp->wds_port[port-1].stats.rx_bytes += pktlen;
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 04/16] staging: wlags49_h2: Add space before parenthesis

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: space required before the open parenthesis '('

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  170 
 1 file changed, 85 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index f5995d4..16b2fe8 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -240,7 +240,7 @@ struct net_device_stats *wl_stats(struct net_device *dev)
wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
wl_unlock(lp, &flags);
return NULL;
}
@@ -249,8 +249,8 @@ struct net_device_stats *wl_stats(struct net_device *dev)
 /* Return the statistics for the appropriate device */
 #ifdef USE_WDS
 
-   for(count = 0; count < NUM_WDS_PORTS; count++) {
-   if(dev == lp->wds_port[count].dev) {
+   for (count = 0; count < NUM_WDS_PORTS; count++) {
+   if (dev == lp->wds_port[count].dev) {
pStats = &(lp->wds_port[count].stats);
}
}
@@ -258,7 +258,7 @@ struct net_device_stats *wl_stats(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);
}
 
@@ -295,7 +295,7 @@ int wl_open(struct net_device *dev)
wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
DBG_TRACE(DbgInfo, "Skipping device open, in RTS mode\n");
wl_unlock(lp, &flags);
return -EIO;
@@ -306,11 +306,11 @@ int wl_open(struct net_device *dev)
parse_config(dev);
 #endif
 
-   if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+   if (lp->portState == WVLAN_PORT_STATE_DISABLED) {
DBG_TRACE(DbgInfo, "Enabling Port 0\n");
status = wl_enable(lp);
 
-   if(status != HCF_SUCCESS) {
+   if (status != HCF_SUCCESS) {
DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n", 
status);
}
}
@@ -330,7 +330,7 @@ int wl_open(struct net_device *dev)
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
-   if(status != HCF_SUCCESS) {
+   if (status != HCF_SUCCESS) {
// Unsuccessful, try reset of the card to recover
status = wl_reset(dev);
}
@@ -339,7 +339,7 @@ int wl_open(struct net_device *dev)
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
-   if(status == HCF_SUCCESS) {
+   if (status == HCF_SUCCESS) {
netif_carrier_on(dev);
WL_WDS_NETIF_CARRIER_ON(lp);
 
@@ -404,7 +404,7 @@ int wl_close(struct net_device *dev)
lp->is_handling_int = WL_NOT_HANDLING_INT; // Stop handling interrupts
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
DBG_TRACE(DbgInfo, "Skipping device close, in RTS mode\n");
wl_unlock(lp, &flags);
return -EIO;
@@ -479,9 +479,9 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
wl_act_int_off(lp);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
/* Handle any RTS IOCTL here */
-   if(cmd == WL_IOCTL_RTS) {
+   if (cmd == WL_IOCTL_RTS) {
DBG_TRACE(DbgInfo, "IOCTL: WL_IOCTL_RTS\n");
ret = wvlan_rts((struct rtsreq *)rq, dev->base_addr);
} else {
@@ -494,12 +494,12 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, 
int cmd)
 #endif  /* USE_RTS */
 
/* Only handle UIL IOCTL requests when the UIL has the system blocked. 
*/
-   if(!((lp->flags & WVLAN2_UIL_BUSY) && (cmd != WVLAN2_IOCTL_UIL))) {
+   if (!((lp->flags & WVLAN2_UIL_BUSY) && (cmd != WVLAN2_IOCTL_UIL))) {
 #ifdef USE_UIL
struct uilreq  *urq = (struct uilreq *)rq;
 #endif /* USE_UIL */
 
-   switch(cmd) {
+   switch (cmd) {
// == Private IOCTLs (up to 16) ==
 #ifdef USE_UIL
case WVLAN2_IOCTL_UIL:
@@ -573,7 +573,7 @@ void wl_tx_timeout(struct net_device *dev)
wl_lock(lp, &flags);
 
 #ifdef USE_RTS
-   if(lp->useRTS == 1) {
+   if (lp->useRTS == 1) {
DBG_TRACE(DbgInfo, "Skipping tx_timeout handler, in RTS 
mode\n");
wl_unlock(lp, &flags);
return;
@@ -584,8 +584,8 @@ void wl_tx_timeout(struct net_device *dev)
is for */
 #i

[PATCH v2 11/16] staging: wlags49_h2: Add space around '='

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issue in wl_netdev.c:
ERROR: spaces required around that '='

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 2d9a352..54741bb 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -878,7 +878,7 @@ int wl_rx(struct net_device *dev)
case 4:
case 5:
case 6:
-   skb->dev =lp->wds_port[port-1].dev;
+   skb->dev = lp->wds_port[port-1].dev;
break;
 #endif  /* USE_WDS */
case 0:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 12/16] staging: wlags49_h2: Do not use assignment in if condition

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issue in wl_netdev.c:
ERROR: do not use assignment in if condition

Signed-off-by: Jelena Bjelja 
---
Changes in v2:
Delete unnecessary line added in a previous version, noted
by Julia Lawall 

 drivers/staging/wlags49_h2/wl_netdev.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 54741bb..eb05e03 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1774,7 +1774,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 = dev->priv;
+   if ((lp != NULL) &&
!(lp->flags & WVLAN2_UIL_BUSY)) {
 
 #ifdef USE_RTS
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 10/16] staging: wlags49_h2: Fix pointer declaration

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issue in wl_netdev.c:
ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index d79a166..2d9a352 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1128,7 +1128,7 @@ static const struct net_device_ops wl_netdev_ops = {
  *  device.
  *
  
**/
-struct net_device * wl_device_alloc(void)
+struct net_device *wl_device_alloc(void)
 {
struct net_device   *dev = NULL;
struct wl_private   *lp = NULL;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 13/16] staging: wlags49_h2: Remove space between function name and open parenthesis

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issue in wl_netdev.c:
WARNING: space prohibited between function name and open parenthesis

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index eb05e03..9b6657f 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1697,7 +1697,7 @@ int wl_send_dma(struct wl_private *lp, struct sk_buff 
*skb, int port)
/* AGAIN, ALL THE QUEUEING DONE HERE IN I/O MODE IS NOT PERFORMED */
 
if (skb == NULL) {
-   DBG_WARNING (DbgInfo, "Nothing to send.\n");
+   DBG_WARNING(DbgInfo, "Nothing to send.\n");
return FALSE;
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 16/16] staging: wlags49_h2: Fix lines over 80 characters

2014-03-18 Thread Jelena Bjelja
Where possible, fix lines that exceed 80 characters in wl_netdev.c
WARNING: line over 80 characters

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   62 +++-
 1 file changed, 38 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 8345833..12fdf60 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -206,8 +206,9 @@ int wl_config(struct net_device *dev, struct ifmap *map)
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
DBG_PARAM(DbgInfo, "map", "0x%p", map);
 
-   /* The only thing we care about here is a port change. Since this not 
needed,
-   ignore the request. */
+   /* The only thing we care about here is a port change.
+* Since this is not needed, ignore the request.
+*/
DBG_TRACE(DbgInfo, "%s: %s called.\n", dev->name, __func__);
 
return 0;
@@ -319,7 +320,8 @@ int wl_open(struct net_device *dev)
status = wl_enable(lp);
 
if (status != HCF_SUCCESS)
-   DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n", 
status);
+   DBG_TRACE(DbgInfo, "Enable port 0 failed: 0x%x\n",
+   status);
}
 
/* Holding the lock too long, make a gap to allow other processes */
@@ -350,14 +352,15 @@ int wl_open(struct net_device *dev)
netif_carrier_on(dev);
WL_WDS_NETIF_CARRIER_ON(lp);
 
-   lp->is_handling_int = WL_HANDLING_INT; /* Start handling 
interrupts */
+   /* Start handling interrupts */
+   lp->is_handling_int = WL_HANDLING_INT;
wl_act_int_on(lp);
 
netif_start_queue(dev);
WL_WDS_NETIF_START_QUEUE(lp);
} else {
-   wl_hcf_error(dev, status);  /* Report the error */
-   netif_device_detach(dev);   /* Stop the device and 
queue */
+   wl_hcf_error(dev, status);  /* Report the error */
+   netif_device_detach(dev);   /* Stop the device and queue */
}
 
wl_unlock(lp, &flags);
@@ -409,7 +412,8 @@ int wl_close(struct net_device *dev)
wl_lock(lp, &flags);
 
wl_act_int_off(lp);
-   lp->is_handling_int = WL_NOT_HANDLING_INT; /* Stop handling interrupts 
*/
+   /* Stop handling interrupts */
+   lp->is_handling_int = WL_NOT_HANDLING_INT;
 
 #ifdef USE_RTS
if (lp->useRTS == 1) {
@@ -494,7 +498,8 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
DBG_TRACE(DbgInfo, "IOCTL: WL_IOCTL_RTS\n");
ret = wvlan_rts((struct rtsreq *)rq, dev->base_addr);
} else {
-   DBG_TRACE(DbgInfo, "IOCTL not supported in RTS mode: 
0x%X\n", cmd);
+   DBG_TRACE(DbgInfo,
+   "IOCTL not supported in RTS mode: 0x%X\n", cmd);
ret = -EOPNOTSUPP;
}
 
@@ -502,7 +507,7 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
}
 #endif  /* USE_RTS */
 
-   /* Only handle UIL IOCTL requests when the UIL has the system blocked. 
*/
+   /* Only handle UIL IOCTL requests when the UIL has the system blocked */
if (!((lp->flags & WVLAN2_UIL_BUSY) && (cmd != WVLAN2_IOCTL_UIL))) {
 #ifdef USE_UIL
struct uilreq  *urq = (struct uilreq *)rq;
@@ -518,12 +523,14 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, 
int cmd)
 #endif  /* USE_UIL */
 
default:
-   DBG_TRACE(DbgInfo, "IOCTL CODE NOT SUPPORTED: 0x%X\n", 
cmd);
+   DBG_TRACE(DbgInfo,
+   "IOCTL CODE NOT SUPPORTED: 0x%X\n", cmd);
ret = -EOPNOTSUPP;
break;
}
} else {
-   DBG_WARNING(DbgInfo, "DEVICE IS BUSY, CANNOT PROCESS 
REQUEST\n");
+   DBG_WARNING(DbgInfo,
+   "DEVICE IS BUSY, CANNOT PROCESS REQUEST\n");
ret = -EBUSY;
}
 
@@ -584,7 +591,8 @@ void wl_tx_timeout(struct net_device *dev)
 
 #ifdef USE_RTS
if (lp->useRTS == 1) {
-   DBG_TRACE(DbgInfo, "Skipping tx_timeout handler, in RTS 
mode\n");
+   DBG_TRACE(DbgInfo,
+   "Skipping tx_timeout handler, in RTS mode\n");
wl_unlock(lp, &flags);
return;
}
@@ -646,7 +654,7 @@ int wl_send(struct wl_private *lp)
WVLAN_LFRAME*txF = NULL;
struct list_head*elemen

[PATCH v2 15/16] staging: wlags49_h2: Fix multi-line commenting

2014-03-18 Thread Jelena Bjelja
Adjust multi-line comments to “net/” kernel coding style in wl_netdev.c.

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  351 ++--
 1 file changed, 203 insertions(+), 148 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index b6a75cd..8345833 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1,4 +1,4 @@
-/***
+/* 
*
  * Agere Systems Inc.
  * Wireless device driver for Linux (wlags49).
  *
@@ -57,11 +57,13 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  * DAMAGE.
  *
- 
**/
+ * 
*
+ */
 
-/***
+/* 
*
  * include files
- 
**/
+ * 
*
+ */
 #include 
 
 #include 
@@ -125,9 +127,10 @@
 /* MODULE_PARM(mtu, "i");  */
 /* MODULE_PARM_DESC(mtu, "MTU");   */
 
-/***
+/* 
*
  * macros
- 
**/
+ * 
*
+ */
 #define BLOCK_INPUT(buf, len) \
do { \
desc->buf_addr = buf; \
@@ -137,13 +140,14 @@
 
 #define BLOCK_INPUT_DMA(buf, len) memcpy(buf, desc_next->buf_addr, pktlen)
 
-/***
+/* 
*
  * function prototypes
- 
**/
+ * 
*
+ */
 
-/***
+/* 
*
  * wl_init()
- 
***
+ * 
*
  *
  *  DESCRIPTION:
  *
@@ -159,7 +163,8 @@
  *  0 on success
  *  errno value otherwise
  *
- 
**/
+ * 
*
+ */
 int wl_init(struct net_device *dev)
 {
 /* unsigned long   flags;  */
@@ -176,9 +181,9 @@ int wl_init(struct net_device *dev)
 } /* wl_init */
 
/**/
 
-/***
+/* 
*
  * wl_config()
- 
***
+ * 
*
  *
  *  DESCRIPTION:
  *
@@ -194,7 +199,8 @@ int wl_init(struct net_device *dev)
  *  0 on success
  *  errno otherwise
  *
- 
**/
+ * 
*
+ */
 int wl_config(struct net_device *dev, struct ifmap *map)
 {
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
@@ -208,9 +214,9 @@ int wl_config(struct net_device *dev, struct ifmap *map)
 } /* wl_config */
 
/**/
 
-/***
+/* 
*
  * wl_stats()
- 
***
+ * 
*
  *
  *  DESCRIPTION:
  *
@@ -225,7 +231,8 @@ int wl_config(struct net_device *dev, struct ifmap *map)
  *  a pointer to a net_device_stats structure containing the network
  *  statistics.
  *
- 
**/
+ * 
*
+ */
 struct 

[PATCH v2 14/16] staging: wlags49_h2: Fix indentation for conditional statement

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
WARNING: suspect code indent for conditional statements

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   56 
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 9b6657f..b6a75cd 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -330,8 +330,8 @@ int wl_open(struct net_device *dev)
wl_lock(lp, &flags);
 
if (status != HCF_SUCCESS) {
-   /* Unsuccessful, try reset of the card to recover */
-   status = wl_reset(dev);
+   /* Unsuccessful, try reset of the card to recover */
+   status = wl_reset(dev);
}
 
/* Holding the lock too long, make a gap to allow other processes */
@@ -479,7 +479,7 @@ int wl_ioctl(struct net_device *dev, struct ifreq *rq, int 
cmd)
 
 #ifdef USE_RTS
if (lp->useRTS == 1) {
-   /* Handle any RTS IOCTL here */
+   /* Handle any RTS IOCTL here */
if (cmd == WL_IOCTL_RTS) {
DBG_TRACE(DbgInfo, "IOCTL: WL_IOCTL_RTS\n");
ret = wvlan_rts((struct rtsreq *)rq, dev->base_addr);
@@ -869,7 +869,7 @@ int wl_rx(struct net_device *dev)
if (pktlen != 0) {
skb = ALLOC_SKB(pktlen);
if (skb != NULL) {
-   /* Set the netdev based on the port */
+   /* Set the netdev based on the port */
switch (port) {
 #ifdef USE_WDS
case 1:
@@ -1016,7 +1016,7 @@ void wl_multicast(struct net_device *dev)
 
if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == 
COMP_ID_FW_STA) {
if (dev->flags & IFF_PROMISC) {
-   /* Enable promiscuous mode */
+   /* Enable promiscuous mode */
lp->ltvRecord.len   = 2;
lp->ltvRecord.typ   = CFG_PROMISCUOUS_MODE;
lp->ltvRecord.u.u16[0]  = CNV_INT_TO_LITTLE(1);
@@ -1024,9 +1024,9 @@ void wl_multicast(struct net_device *dev)
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
} else if ((netdev_mc_count(dev) > HCF_MAX_MULTICAST) ||
(dev->flags & IFF_ALLMULTI)) {
-   /* Shutting off this filter will enable all multicast 
frames to
-   be sent up from the device; however, this is a static 
RID, so
-   a call to wl_apply() is needed */
+   /* Shutting off this filter will enable all 
multicast frames to
+   be sent up from the device; however, this is a 
static RID, so
+   a call to wl_apply() is needed */
lp->ltvRecord.len   = 2;
lp->ltvRecord.typ   = 
CFG_CNF_RX_ALL_GROUP_ADDR;
lp->ltvRecord.u.u16[0]  = CNV_INT_TO_LITTLE(0);
@@ -1034,7 +1034,7 @@ void wl_multicast(struct net_device *dev)
hcf_put_info(&(lp->hcfCtx), 
(LTVP)&(lp->ltvRecord));
wl_apply(lp);
} else if (!netdev_mc_empty(dev)) {
-   /* Set the multicast addresses */
+   /* Set the multicast addresses */
lp->ltvRecord.len = (netdev_mc_count(dev) * 3) 
+ 1;
lp->ltvRecord.typ = CFG_GROUP_ADDR;
 
@@ -1790,25 +1790,25 @@ int wl_rx_dma(struct net_device *dev)
desc = hcf_dma_rx_get(&(lp->hcfCtx));
 
if (desc != NULL) {
-/* Check and see if we rcvd. a WMP frame */
-/*
-   if (((*(hcf_8 *)&desc->buf_addr[HFS_STAT]) &
-   (HFS_STAT_MSG_TYPE | HFS_STAT_ERR)) == HFS_STAT_WMP_MSG)
-   {
-   DBG_TRACE(DbgInfo, "Got a WMP frame\n");
-
-   x.len = sizeof(CFG_MB_INFO_RANGE2_STRCT) / 
sizeof(hcf_16);
-   x.typ = CFG_MB_INFO;
-   x.base_typ = CFG_WMP;
-   x.frag_cnt = 2;
-   x.frag_buf[0].frag_len  = GET_BUF_CNT(descp) / 
sizeof(hcf_16);
-   x.frag_buf[0].frag_addr = (hcf_8 *) descp->buf_addr ;
-   x.frag_buf[1].frag_len  = 
(GET_BUF_CNT(descp->next_desc_addr) + 1) / sizeof(hcf_16);
-   x.frag_buf[1].frag_addr = (hcf_8 *) 
descp->next_desc_addr->buf_addr ;
-
-  

[PATCH v2 05/16] staging: wlags49_h2: Fix C99 style commenting

2014-03-18 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: do not use C99 // comments

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |  150 
 1 file changed, 75 insertions(+), 75 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 16b2fe8..cc226a6 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -68,31 +68,31 @@
 #include 
 #include 
 #include 
-// #include 
-// #include 
-// #include 
-// #include 
-// #include 
-//#include 
-// #include 
-// #include 
-// #include 
-// #include 
-// #include 
-// // #include 
+/* #include */
+/* #include*/
+/* #include  */
+/* #include */
+/* #include*/
+/* #include */
+/* #include */
+/* #include*/
+/* #include */
+/* #include*/
+/* #include  */
+/* #include  */
 
 #include 
 #include 
 #include 
-// #include 
-// #include 
-// #include 
+/* #include*/
+/* #include*/
+/* #include*/
 
 #include 
 
 #include 
 #include 
-// #include 
+/* #include  */
 
 #include 
 #include 
@@ -121,9 +121,9 @@
 #define MTU_MAX (HCF_MAX_MSG - ETH_HLEN)
 #endif
 
-//static int mtu = MTU_MAX;
-//MODULE_PARM(mtu, "i");
-//MODULE_PARM_DESC(mtu, "MTU");
+/* static int mtu = MTU_MAX;   */
+/* MODULE_PARM(mtu, "i");  */
+/* MODULE_PARM_DESC(mtu, "MTU");   */
 
 
/***
  * macros
@@ -160,18 +160,18 @@
  
**/
 int wl_init(struct net_device *dev)
 {
-//unsigned long   flags;
-//struct wl_private   *lp = wl_priv(dev);
+/* unsigned long   flags;  */
+/*struct wl_private   *lp = wl_priv(dev);  */
 
DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 
/* Nothing to do, but grab the spinlock anyway just in case we ever need
this routine */
-//  wl_lock(lp, &flags);
-//  wl_unlock(lp, &flags);
+/*  wl_lock( lp, &flags ); */
+/*  wl_unlock( lp, &flags );   */
 
return 0;
-} // wl_init
+} /* wl_init */
 
/**/
 
 
/***
@@ -203,7 +203,7 @@ int wl_config(struct net_device *dev, struct ifmap *map)
DBG_TRACE(DbgInfo, "%s: %s called.\n", dev->name, __func__);
 
return 0;
-} // wl_config
+} /* wl_config */
 
/**/
 
 
/***
@@ -233,7 +233,7 @@ struct net_device_stats *wl_stats(struct net_device *dev)
struct net_device_stats *pStats;
struct wl_private   *lp = wl_priv(dev);
 
-   //DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+   /* DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); */
 
pStats = NULL;
 
@@ -265,7 +265,7 @@ struct net_device_stats *wl_stats(struct net_device *dev)
wl_unlock(lp, &flags);
 
return pStats;
-} // wl_stats
+} /* wl_stats */
 
/**/
 
 
/***
@@ -315,7 +315,7 @@ int wl_open(struct net_device *dev)
}
}
 
-   // Holding the lock too long, make a gap to allow other processes
+   /* Holding the lock too long, make a gap to allow other processes */
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
@@ -326,16 +326,16 @@ int wl_open(struct net_device *dev)
status = wl_apply(lp);
}
 
-   // Holding the lock too long, make a gap to allow other processes
+   /* Holding the lock too long, make a gap to allow other processes */
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
if (status != HCF_SUCCESS) {
-   // Unsuccessful, try reset of the card to recover
+   /* Unsuccessful, try reset of the card to recover */
status = wl_reset(dev);
}
 
-   // Holding the lock too long, make a gap to allow other processes
+   /* Holding the lock too long, make a gap to allow other processes */
wl_unlock(lp, &flags);
wl_lock(lp, &flags);
 
@@ -343,7 +343,7 @@ int wl_open(struct net_device *dev)
netif_carrier_on(dev);
WL_WDS_NETIF_CARRIER_ON(lp);
 
-   lp->is_handling_int = WL_HANDLING_INT; // Start handling 
interrupts
+   lp->is_handling_int = WL_HANDLING_INT; /* Start handling 
interrupts */
wl_act_int_on(

[PATCH 1/5] staging: wlags49_h2: Enclose macro in a do-while loop

2014-03-19 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:
ERROR: Macros with multiple statements should be enclosed in a do -
while loop

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 255d291..0e553ae 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -107,9 +107,11 @@
  * macros
  
**/
 #define BLOCK_INPUT(buf, len) \
-desc->buf_addr = buf; \
-desc->BUF_SIZE = len; \
-status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
+   do { \
+   desc->buf_addr = buf; \
+   desc->BUF_SIZE = len; \
+   status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0); \
+   } while (0)
 
 #define BLOCK_INPUT_DMA(buf, len) memcpy( buf, desc_next->buf_addr, pktlen )
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/5] staging: wlags49_h2: Fix checkpatch issues in wl_netdev.c

2014-03-19 Thread Jelena Bjelja
This patchset fixes most of the checkpatch.pl issues in wl_netdev.c

Jelena Bjelja (5):
  staging: wlags49_h2: Enclose macro in a do-while loop
  Delete unnecessary spaces
  Remove trailing whitespace
  staging: wlags49_h2: Do not use assignment in if condition
  staging: wlags49_h2: Delete unnecessary braces

 drivers/staging/wlags49_h2/wl_netdev.c |   39 ++--
 1 file changed, 17 insertions(+), 22 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5] Remove trailing whitespace

2014-03-19 Thread Jelena Bjelja
Remove trailing whitespace in wl_netdev.c

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 8e571b2..eb428ae 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -172,7 +172,7 @@ int wl_config(struct net_device *dev, struct ifmap *map)
 
/*
 * The only thing we care about here is a port change.
-* Since this not needed, ignore the request. 
+* Since this not needed, ignore the request.
 */
DBG_TRACE(DbgInfo, "%s: %s called.\n", dev->name, __func__);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/5] Delete unnecessary spaces

2014-03-19 Thread Jelena Bjelja
Fix the following checkpatch.pl issues in wl_netdev.c:

ERROR: space prohibited after that open parenthesis '('
#116: FILE: drivers/staging/wlags49_h2/wl_netdev.c:116:

ERROR: space prohibited before that close parenthesis ')'
#116: FILE: drivers/staging/wlags49_h2/wl_netdev.c:116:

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 0e553ae..8e571b2 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
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/5] staging: wlags49_h2: Do not use assignment in if condition

2014-03-19 Thread Jelena Bjelja
Fix the following checkpatch.pl issue in wl_netdev.c:
ERROR: do not use assignment in if condition

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index eb428ae..9dbbc15 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -1819,7 +1819,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) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/5] staging: wlags49_h2: Delete unnecessary braces

2014-03-19 Thread Jelena Bjelja
Fix the following checkpatch.pl warnings in wl_netdev.c:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Jelena Bjelja 
---
 drivers/staging/wlags49_h2/wl_netdev.c |   24 
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c 
b/drivers/staging/wlags49_h2/wl_netdev.c
index 9dbbc15..1a0ddf4 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -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 */
@@ -1936,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.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html