[OPW,kernel,03/13] staging: rtl8187se: fix checkpatch space and tab warnings
diff mbox

Message ID 1382316061-31542-4-git-send-email-teobaluta@gmail.com
State New, archived
Headers show

Commit Message

Teodora Baluta Oct. 21, 2013, 12:40 a.m. UTC
This patch fixes checkpatch issues regarding space and tab like:

WARNING: please, no spaces at the start of a line
ERROR: code indent should use tabs where possible
WARNING: suspect code indent for conditional statements (2, 4)
ERROR: space required before the open parenthesis '('
ERROR: space required after that ',' (ctx:VxO)

Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |   84 ++++++++++----------
 1 file changed, 43 insertions(+), 41 deletions(-)

Comments

Josh Triplett Oct. 21, 2013, 6:57 p.m. UTC | #1
On Mon, Oct 21, 2013 at 03:40:51AM +0300, Teodora Baluta wrote:
> This patch fixes checkpatch issues regarding space and tab like:
> 
> WARNING: please, no spaces at the start of a line
> ERROR: code indent should use tabs where possible
> WARNING: suspect code indent for conditional statements (2, 4)
> ERROR: space required before the open parenthesis '('
> ERROR: space required after that ',' (ctx:VxO)
> 
> Signed-off-by: Teodora Baluta <teobaluta@gmail.com>

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

>  drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |   84 ++++++++++----------
>  1 file changed, 43 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
> index b5c03ad..887409b 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
> @@ -187,8 +187,8 @@ int ieee80211_encrypt_fragment(
>  	int res;
>  
>   /*added to care about null crypt condition, to solve that system hangs when shared keys error*/
> -        if (!crypt || !crypt->ops)
> -        return -1;
> +	if (!crypt || !crypt->ops)
> +		return -1;
>  
>  #ifdef CONFIG_IEEE80211_CRYPT_TKIP
>  	struct ieee80211_hdr_4addr *header;
> @@ -277,36 +277,36 @@ static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
>  static int
>  ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
>  {
> -  struct ether_header *eh = (struct ether_header *)skb->data;
> -  unsigned int wme_UP = 0;
> +	struct ether_header *eh = (struct ether_header *)skb->data;
> +	unsigned int wme_UP = 0;
>  
> -  if(!network->QoS_Enable) {
> -     skb->priority = 0;
> -     return(wme_UP);
> -  }
> +	if (!network->QoS_Enable) {
> +		skb->priority = 0;
> +		return(wme_UP);
> +	}
>  
> -  if(eh->ether_type == __constant_htons(ETHERTYPE_IP)) {
> -    const struct iphdr *ih = (struct iphdr *)(skb->data + \
> +	if (eh->ether_type == __constant_htons(ETHERTYPE_IP)) {
> +		const struct iphdr *ih = (struct iphdr *)(skb->data + \
>  		    sizeof(struct ether_header));
> -    wme_UP = (ih->tos >> 5)&0x07;
> -  } else if (vlan_tx_tag_present(skb)) {/* vtag packet */
> +		wme_UP = (ih->tos >> 5)&0x07;
> +	} else if (vlan_tx_tag_present(skb)) {/* vtag packet */
>  #ifndef VLAN_PRI_SHIFT
>  #define VLAN_PRI_SHIFT  13              /* Shift to find VLAN user priority */
>  #define VLAN_PRI_MASK   7               /* Mask for user priority bits in VLAN */
>  #endif
> -	u32 tag = vlan_tx_tag_get(skb);
> -	wme_UP = (tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK;
> -  } else if(ETH_P_PAE ==  ntohs(((struct ethhdr *)skb->data)->h_proto)) {
> -    wme_UP = 7;
> -  }
> -
> -  skb->priority = wme_UP;
> -  return(wme_UP);
> +		u32 tag = vlan_tx_tag_get(skb);
> +		wme_UP = (tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK;
> +	} else if (ETH_P_PAE ==  ntohs(((struct ethhdr *)skb->data)->h_proto)) {
> +		wme_UP = 7;
> +	}
> +
> +	skb->priority = wme_UP;
> +	return(wme_UP);
>  }
>  
>  /* SKBs are added to the ieee->tx_queue. */
>  int ieee80211_rtl_xmit(struct sk_buff *skb,
> -		   struct net_device *dev)
> +		       struct net_device *dev)
>  {
>  	struct ieee80211_device *ieee = netdev_priv(dev);
>  	struct ieee80211_txb *txb = NULL;
> @@ -332,15 +332,17 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
>  	 * If there is no driver handler to take the TXB, don't bother
>  	 * creating it...
>  	 * */
> -	if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE))||
> -	   ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
> +	if ((!ieee->hard_start_xmit &&
> +	     !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)) ||
> +	    ((!ieee->softmac_data_hard_start_xmit &&
> +	      (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
>  		printk(KERN_WARNING "%s: No xmit handler.\n",
>  		       ieee->dev->name);
>  		goto success;
>  	}
>  
> -	ieee80211_classify(skb,&ieee->current_network);
> -	if(likely(ieee->raw_tx == 0)){
> +	ieee80211_classify(skb, &ieee->current_network);
> +	if (likely(ieee->raw_tx == 0)) {
>  
>  		if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
>  			printk(KERN_WARNING "%s: skb too small (%d).\n",
> @@ -380,7 +382,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
>  		/* Determine total amount of storage required for TXB packets */
>  		bytes = skb->len + SNAP_SIZE + sizeof(u16);
>  
> -		if(ieee->current_network.QoS_Enable) {
> +		if (ieee->current_network.QoS_Enable) {
>  			if (encrypt)
>  				fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA |
>  					IEEE80211_FCTL_WEP;
> @@ -491,9 +493,9 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
>  				/* The last fragment takes the remaining length */
>  				bytes = bytes_last_frag;
>  			}
> -			if(ieee->current_network.QoS_Enable) {
> +			if (ieee->current_network.QoS_Enable) {
>  			  /*
> -			   * add 1 only indicate to corresponding seq number 
> +			   * add 1 only indicate to corresponding seq number
>  			   * control 2006/7/12
>  			   */
>  			  frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[UP2AC(skb->priority)+1]<<4 | i);
> @@ -527,17 +529,17 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
>  		}
>  		/* Advance sequence number in data frame. */
>  		if (ieee->current_network.QoS_Enable) {
> -		  if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF)
> -			ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0;
> -		  else
> -			ieee->seq_ctrl[UP2AC(skb->priority) + 1]++;
> +			if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF)
> +				ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0;
> +			else
> +				ieee->seq_ctrl[UP2AC(skb->priority) + 1]++;
>  		} else {
> -  		  if (ieee->seq_ctrl[0] == 0xFFF)
> -			ieee->seq_ctrl[0] = 0;
> -		  else
> -			ieee->seq_ctrl[0]++;
> +			if (ieee->seq_ctrl[0] == 0xFFF)
> +				ieee->seq_ctrl[0] = 0;
> +			else
> +				ieee->seq_ctrl[0]++;
>  		}
> -	}else{
> +	} else {
>  		if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
>  			printk(KERN_WARNING "%s: skb too small (%d).\n",
>  			ieee->dev->name, skb->len);
> @@ -545,7 +547,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
>  		}
>  
>  		txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC);
> -		if(!txb){
> +		if (!txb) {
>  			printk(KERN_WARNING "%s: Could not allocate TXB\n",
>  			ieee->dev->name);
>  			goto failed;
> @@ -553,16 +555,16 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
>  
>  		txb->encrypted = 0;
>  		txb->payload_size = skb->len;
> -		memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len);
> +		memcpy(skb_put(txb->fragments[0], skb->len), skb->data, skb->len);
>  	}
>  
>   success:
>  	spin_unlock_irqrestore(&ieee->lock, flags);
>  		dev_kfree_skb_any(skb);
>  	if (txb) {
> -		if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){
> +		if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) {
>  			ieee80211_softmac_xmit(txb, ieee);
> -		}else{
> +		} else {
>  			if ((*ieee->hard_start_xmit)(txb, dev) == 0) {
>  				stats->tx_packets++;
>  				stats->tx_bytes += txb->payload_size;
> -- 
> 1.7.10.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Patch
diff mbox

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index b5c03ad..887409b 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -187,8 +187,8 @@  int ieee80211_encrypt_fragment(
 	int res;
 
  /*added to care about null crypt condition, to solve that system hangs when shared keys error*/
-        if (!crypt || !crypt->ops)
-        return -1;
+	if (!crypt || !crypt->ops)
+		return -1;
 
 #ifdef CONFIG_IEEE80211_CRYPT_TKIP
 	struct ieee80211_hdr_4addr *header;
@@ -277,36 +277,36 @@  static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
 static int
 ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
 {
-  struct ether_header *eh = (struct ether_header *)skb->data;
-  unsigned int wme_UP = 0;
+	struct ether_header *eh = (struct ether_header *)skb->data;
+	unsigned int wme_UP = 0;
 
-  if(!network->QoS_Enable) {
-     skb->priority = 0;
-     return(wme_UP);
-  }
+	if (!network->QoS_Enable) {
+		skb->priority = 0;
+		return(wme_UP);
+	}
 
-  if(eh->ether_type == __constant_htons(ETHERTYPE_IP)) {
-    const struct iphdr *ih = (struct iphdr *)(skb->data + \
+	if (eh->ether_type == __constant_htons(ETHERTYPE_IP)) {
+		const struct iphdr *ih = (struct iphdr *)(skb->data + \
 		    sizeof(struct ether_header));
-    wme_UP = (ih->tos >> 5)&0x07;
-  } else if (vlan_tx_tag_present(skb)) {/* vtag packet */
+		wme_UP = (ih->tos >> 5)&0x07;
+	} else if (vlan_tx_tag_present(skb)) {/* vtag packet */
 #ifndef VLAN_PRI_SHIFT
 #define VLAN_PRI_SHIFT  13              /* Shift to find VLAN user priority */
 #define VLAN_PRI_MASK   7               /* Mask for user priority bits in VLAN */
 #endif
-	u32 tag = vlan_tx_tag_get(skb);
-	wme_UP = (tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK;
-  } else if(ETH_P_PAE ==  ntohs(((struct ethhdr *)skb->data)->h_proto)) {
-    wme_UP = 7;
-  }
-
-  skb->priority = wme_UP;
-  return(wme_UP);
+		u32 tag = vlan_tx_tag_get(skb);
+		wme_UP = (tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK;
+	} else if (ETH_P_PAE ==  ntohs(((struct ethhdr *)skb->data)->h_proto)) {
+		wme_UP = 7;
+	}
+
+	skb->priority = wme_UP;
+	return(wme_UP);
 }
 
 /* SKBs are added to the ieee->tx_queue. */
 int ieee80211_rtl_xmit(struct sk_buff *skb,
-		   struct net_device *dev)
+		       struct net_device *dev)
 {
 	struct ieee80211_device *ieee = netdev_priv(dev);
 	struct ieee80211_txb *txb = NULL;
@@ -332,15 +332,17 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 	 * If there is no driver handler to take the TXB, don't bother
 	 * creating it...
 	 * */
-	if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE))||
-	   ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
+	if ((!ieee->hard_start_xmit &&
+	     !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)) ||
+	    ((!ieee->softmac_data_hard_start_xmit &&
+	      (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
 		printk(KERN_WARNING "%s: No xmit handler.\n",
 		       ieee->dev->name);
 		goto success;
 	}
 
-	ieee80211_classify(skb,&ieee->current_network);
-	if(likely(ieee->raw_tx == 0)){
+	ieee80211_classify(skb, &ieee->current_network);
+	if (likely(ieee->raw_tx == 0)) {
 
 		if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
 			printk(KERN_WARNING "%s: skb too small (%d).\n",
@@ -380,7 +382,7 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 		/* Determine total amount of storage required for TXB packets */
 		bytes = skb->len + SNAP_SIZE + sizeof(u16);
 
-		if(ieee->current_network.QoS_Enable) {
+		if (ieee->current_network.QoS_Enable) {
 			if (encrypt)
 				fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA |
 					IEEE80211_FCTL_WEP;
@@ -491,9 +493,9 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 				/* The last fragment takes the remaining length */
 				bytes = bytes_last_frag;
 			}
-			if(ieee->current_network.QoS_Enable) {
+			if (ieee->current_network.QoS_Enable) {
 			  /*
-			   * add 1 only indicate to corresponding seq number 
+			   * add 1 only indicate to corresponding seq number
 			   * control 2006/7/12
 			   */
 			  frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[UP2AC(skb->priority)+1]<<4 | i);
@@ -527,17 +529,17 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 		}
 		/* Advance sequence number in data frame. */
 		if (ieee->current_network.QoS_Enable) {
-		  if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF)
-			ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0;
-		  else
-			ieee->seq_ctrl[UP2AC(skb->priority) + 1]++;
+			if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF)
+				ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0;
+			else
+				ieee->seq_ctrl[UP2AC(skb->priority) + 1]++;
 		} else {
-  		  if (ieee->seq_ctrl[0] == 0xFFF)
-			ieee->seq_ctrl[0] = 0;
-		  else
-			ieee->seq_ctrl[0]++;
+			if (ieee->seq_ctrl[0] == 0xFFF)
+				ieee->seq_ctrl[0] = 0;
+			else
+				ieee->seq_ctrl[0]++;
 		}
-	}else{
+	} else {
 		if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
 			printk(KERN_WARNING "%s: skb too small (%d).\n",
 			ieee->dev->name, skb->len);
@@ -545,7 +547,7 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 		}
 
 		txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC);
-		if(!txb){
+		if (!txb) {
 			printk(KERN_WARNING "%s: Could not allocate TXB\n",
 			ieee->dev->name);
 			goto failed;
@@ -553,16 +555,16 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 
 		txb->encrypted = 0;
 		txb->payload_size = skb->len;
-		memcpy(skb_put(txb->fragments[0],skb->len), skb->data, skb->len);
+		memcpy(skb_put(txb->fragments[0], skb->len), skb->data, skb->len);
 	}
 
  success:
 	spin_unlock_irqrestore(&ieee->lock, flags);
 		dev_kfree_skb_any(skb);
 	if (txb) {
-		if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){
+		if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) {
 			ieee80211_softmac_xmit(txb, ieee);
-		}else{
+		} else {
 			if ((*ieee->hard_start_xmit)(txb, dev) == 0) {
 				stats->tx_packets++;
 				stats->tx_bytes += txb->payload_size;