diff mbox

[OPW,kernel,04/11] staging: rtl8187se: Fixes braces in ieee80211/ieee80211_softmac.c

Message ID 616c9b8a050495ac07dab931cc3b7b609a30b8e6.1394195021.git.anarey@gmail.com
State New, archived
Headers show

Commit Message

Ana Rey March 7, 2014, 12:33 p.m. UTC
This patch fixes braces errors and warning as the codingStyle of the
kernel recommends in ieee80211/ieee80211_softmac.c

Thus, this patch fixes these errors (and warning) found by checkpatch.pl:

ERROR: that open brace { should be on the previous line.
WARNING: braces {} are not necessary for single statement blocks.
ERROR:  else should follow close brace '}'.

Signed-off-by: Ana Rey <anarey@gmail.com>
---
 .../rtl8187se/ieee80211/ieee80211_softmac.c        | 80 ++++++++--------------
 1 file changed, 27 insertions(+), 53 deletions(-)

Comments

Paul E. McKenney March 7, 2014, 4:29 p.m. UTC | #1
On Fri, Mar 07, 2014 at 01:33:04PM +0100, Ana Rey wrote:
> This patch fixes braces errors and warning as the codingStyle of the
> kernel recommends in ieee80211/ieee80211_softmac.c
> 
> Thus, this patch fixes these errors (and warning) found by checkpatch.pl:
> 
> ERROR: that open brace { should be on the previous line.
> WARNING: braces {} are not necessary for single statement blocks.
> ERROR:  else should follow close brace '}'.
> 
> Signed-off-by: Ana Rey <anarey@gmail.com>
> ---
>  .../rtl8187se/ieee80211/ieee80211_softmac.c        | 80 ++++++++--------------
>  1 file changed, 27 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> index c027b73..63fb033 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c

[ . . . ]

> @@ -791,12 +779,11 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
>  		tag += rate_ex_len - 2;
>  	}
> 
> -	if (wpa_ie_len)
> -	{
> -		if (ieee->iw_mode == IW_MODE_ADHOC)
> -		{ /* as Windows will set pairwise key same as the group key
> -		   * which is not allowed in Linux, so set this for IOT issue.
> -		   * WB 2008.07.07 */
> +	if (wpa_ie_len)	{
> +		if (ieee->iw_mode == IW_MODE_ADHOC) {
> +		 /* as Windows will set pairwise key same as the group key

Why not line up the "/" above with the "memcpy" below?

							Thanx, Paul

> +		  * which is not allowed in Linux, so set this for IOT issue.
> +		  * WB 2008.07.07 */
>  			memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4);
>  		}
> 
> @@ -965,11 +952,10 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  	 * [2] authen type
>  	 */
>  	if (ieee->wpax_type_set) {
> -		if (IEEE_PROTO_WPA == encry_proto) {
> +		if (IEEE_PROTO_WPA == encry_proto)
>  			rsn_len = 0;
> -		} else if (IEEE_PROTO_RSN == encry_proto) {
> +		else if (IEEE_PROTO_RSN == encry_proto)
>  			wpa_len = 0;
> -		}
>  	}
>  	len = sizeof(struct ieee80211_assoc_request_frame)+
>  		+ beacon->ssid_len /* essid tagged val */
> @@ -1026,13 +1012,12 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  	memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
> 
>  	tag = skb_put(skb, wmm_info_len);
> -	if (wmm_info_len) {
> +	if (wmm_info_len)
>  		ieee80211_WMM_Info(ieee, &tag);
> -	}
> +
>  	tag = skb_put(skb, turbo_info_len);
> -	if (turbo_info_len) {
> +	if (turbo_info_len)
>  		ieee80211_TURBO_Info(ieee, &tag);
> -	}
>  	return skb;
>  }
> 
> @@ -1082,8 +1067,7 @@ static void ieee80211_associate_step1(struct ieee80211_device *ieee)
>  	if (!skb) {
> 
>  		ieee80211_associate_abort(ieee);
> -	}
> -	else {
> +	} else {
>  		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING;
>  		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
>  		softmac_mgmt_xmit(skb, ieee);
> @@ -1452,9 +1436,8 @@ inline void ieee80211_rx_auth_rq(struct ieee80211_device *ieee,
>  	ieee->softmac_stats.rx_auth_rq++;
> 
>  	status = auth_rq_parse(skb, dest);
> -	if (status != -1) {
> +	if (status != -1)
>  		ieee80211_resp_to_auth(ieee, status, dest);
> -	}
>  }
> 
>  inline void
> @@ -1464,9 +1447,9 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
>  	u8 dest[ETH_ALEN];
> 
>  	ieee->softmac_stats.rx_ass_rq++;
> -	if (assoc_rq_parse(skb, dest) != -1) {
> +	if (assoc_rq_parse(skb, dest) != -1)
>  		ieee80211_resp_to_assoc_rq(ieee, dest);
> -	}
> +
>  	printk(KERN_INFO"New client associated: %pM\n", dest);
>  }
> 
> @@ -1664,9 +1647,8 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  					ieee->softmac_stats.rx_ass_ok++;
> 
>  					if (1 == rx_stats->nic_type) /* card type is 8187 */
> -					{
>  						goto associate_complete;
> -					}
> +
>  					assoc_resp = (struct ieee80211_assoc_response_frame*)skb->data;
>  					info_element = &assoc_resp->info_element;
>  					left = skb->len - ((void*)info_element - (void*)assoc_resp);
> @@ -1712,8 +1694,8 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  						info_element = (struct ieee80211_info_element *)
>  							&info_element->data[info_element->len];
>  					}
> -					if (!ieee->init_wmmparam_flag) /* legacy AP, reset the AC_xx_param register */
> -					{
> +					/* legacy AP, reset the AC_xx_param register */
> +					if (!ieee->init_wmmparam_flag) {
>  						queue_work(ieee->wq, &ieee->wmm_param_update_wq);
>  						ieee->init_wmmparam_flag = 1; /* indicate AC_xx_param upated since last associate */
>  					}
> @@ -2087,12 +2069,8 @@ void ieee80211_start_bss(struct ieee80211_device *ieee)
>  	 * including a Country IE.
>  	 */
>  	if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
> -	{
>  		if (!ieee->bGlobalDomain)
> -		{
>  			return;
> -		}
> -	}
>  	/* check if we have already found the net we
>  	 * are interested in (if any).
>  	 * if not (we are disassociated and we are not
> @@ -2171,9 +2149,7 @@ static void ieee80211_associate_retry_wq(struct work_struct *work)
>  	}
>  	/* YJ,add,080828, notify os here */
>  	if (ieee->state == IEEE80211_NOLINK)
> -	{
>  		notify_wx_assoc_event(ieee);
> -	}
>  	/* YJ,add,080828,end */
>  	spin_unlock_irqrestore(&ieee->lock, flags);
> 
> @@ -2324,9 +2300,8 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
> 
>  	ieee->state = IEEE80211_NOLINK;
>  	ieee->sync_scan_hurryup = 0;
> -	for (i = 0; i < 5; i++) {
> +	for (i = 0; i < 5; i++)
>  		ieee->seq_ctrl[i] = 0;
> -	}
> 
>  	ieee->assoc_id = 0;
>  	ieee->queue_stop = 0;
> @@ -2539,8 +2514,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
>  		if (!value) {
>  			sec.flags |= SEC_LEVEL;
>  			sec.level = SEC_LEVEL_0;
> -		}
> -		else {
> +		} else {
>  			sec.flags |= SEC_LEVEL;
>  			sec.level = SEC_LEVEL_1;
>  		}
> -- 
> 1.8.5.3
> 
> -- 
> 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/d/optout.
>
diff mbox

Patch

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index c027b73..63fb033 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -409,8 +409,7 @@  static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
 	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
 	down(&ieee->scan_sem);
 
-	while (1)
-	{
+	while (1) {
 		do {
 			ch++;
 			if (ch > MAX_CHANNEL_NUMBER)
@@ -440,9 +439,8 @@  static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
 
 		ieee->set_chan(ieee->dev, ch);
 		if (channel_map[ch] == 1)
-		{
 			ieee80211_send_probe_requests(ieee);
-		}
+
 		/* this prevent excessive time wait when we
 		 * need to wait for a syncro scan to end..
 		 */
@@ -466,8 +464,7 @@  void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
 	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
 	down(&ieee->scan_sem);
 	ch = ieee->current_network.channel;
-	while (1)
-	{
+	while (1) {
 		/* this function can be called in two situations
 		 * 1- We have switched to ad-hoc mode and we are
 		 *    performing a complete syncro scan before conclude
@@ -487,9 +484,8 @@  void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
 		 * if the state become LINKED because of the #1 situation
 		 */
 		if (ieee->state == IEEE80211_LINKED)
-		{
 			goto out;
-		}
+
 		if (channel_map[ieee->current_network.channel] > 0)
 			ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
@@ -528,8 +524,7 @@  static void ieee80211_softmac_scan_wq(struct work_struct *work)
 				goto out; /* no good chans */
 	} while (!channel_map[ieee->current_network.channel]);
 
-	if (ieee->scanning == 0)
-	{
+	if (ieee->scanning == 0) {
 		printk("error out, scanning = 0\n");
 		goto out;
 	}
@@ -615,16 +610,12 @@  void ieee80211_stop_scan(struct ieee80211_device *ieee)
 /* called with ieee->lock held */
 void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
 {
-	if (IS_DOT11D_ENABLE(ieee))
-	{
+	if (IS_DOT11D_ENABLE(ieee)) {
 		if (IS_COUNTRY_IE_VALID(ieee))
-		{
 			RESET_CIE_WATCHDOG(ieee);
-		}
 	}
 	if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) {
-		if (ieee->scanning == 0)
-		{
+		if (ieee->scanning == 0) {
 			ieee->scanning = 1;
 #if 1
 			queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0);
@@ -637,12 +628,9 @@  void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
 /* called with wx_sem held */
 void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
 {
-	if (IS_DOT11D_ENABLE(ieee))
-	{
+	if (IS_DOT11D_ENABLE(ieee)) {
 		if (IS_COUNTRY_IE_VALID(ieee))
-		{
 			RESET_CIE_WATCHDOG(ieee);
-		}
 	}
 	ieee->sync_scan_hurryup = 0;
 
@@ -791,12 +779,11 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
 		tag += rate_ex_len - 2;
 	}
 
-	if (wpa_ie_len)
-	{
-		if (ieee->iw_mode == IW_MODE_ADHOC)
-		{ /* as Windows will set pairwise key same as the group key
-		   * which is not allowed in Linux, so set this for IOT issue.
-		   * WB 2008.07.07 */
+	if (wpa_ie_len)	{
+		if (ieee->iw_mode == IW_MODE_ADHOC) {
+		 /* as Windows will set pairwise key same as the group key
+		  * which is not allowed in Linux, so set this for IOT issue.
+		  * WB 2008.07.07 */
 			memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4);
 		}
 
@@ -965,11 +952,10 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 	 * [2] authen type
 	 */
 	if (ieee->wpax_type_set) {
-		if (IEEE_PROTO_WPA == encry_proto) {
+		if (IEEE_PROTO_WPA == encry_proto)
 			rsn_len = 0;
-		} else if (IEEE_PROTO_RSN == encry_proto) {
+		else if (IEEE_PROTO_RSN == encry_proto)
 			wpa_len = 0;
-		}
 	}
 	len = sizeof(struct ieee80211_assoc_request_frame)+
 		+ beacon->ssid_len /* essid tagged val */
@@ -1026,13 +1012,12 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 	memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
 
 	tag = skb_put(skb, wmm_info_len);
-	if (wmm_info_len) {
+	if (wmm_info_len)
 		ieee80211_WMM_Info(ieee, &tag);
-	}
+
 	tag = skb_put(skb, turbo_info_len);
-	if (turbo_info_len) {
+	if (turbo_info_len)
 		ieee80211_TURBO_Info(ieee, &tag);
-	}
 	return skb;
 }
 
@@ -1082,8 +1067,7 @@  static void ieee80211_associate_step1(struct ieee80211_device *ieee)
 	if (!skb) {
 
 		ieee80211_associate_abort(ieee);
-	}
-	else {
+	} else {
 		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING;
 		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
 		softmac_mgmt_xmit(skb, ieee);
@@ -1452,9 +1436,8 @@  inline void ieee80211_rx_auth_rq(struct ieee80211_device *ieee,
 	ieee->softmac_stats.rx_auth_rq++;
 
 	status = auth_rq_parse(skb, dest);
-	if (status != -1) {
+	if (status != -1)
 		ieee80211_resp_to_auth(ieee, status, dest);
-	}
 }
 
 inline void
@@ -1464,9 +1447,9 @@  ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
 	u8 dest[ETH_ALEN];
 
 	ieee->softmac_stats.rx_ass_rq++;
-	if (assoc_rq_parse(skb, dest) != -1) {
+	if (assoc_rq_parse(skb, dest) != -1)
 		ieee80211_resp_to_assoc_rq(ieee, dest);
-	}
+
 	printk(KERN_INFO"New client associated: %pM\n", dest);
 }
 
@@ -1664,9 +1647,8 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 					ieee->softmac_stats.rx_ass_ok++;
 
 					if (1 == rx_stats->nic_type) /* card type is 8187 */
-					{
 						goto associate_complete;
-					}
+
 					assoc_resp = (struct ieee80211_assoc_response_frame*)skb->data;
 					info_element = &assoc_resp->info_element;
 					left = skb->len - ((void*)info_element - (void*)assoc_resp);
@@ -1712,8 +1694,8 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 						info_element = (struct ieee80211_info_element *)
 							&info_element->data[info_element->len];
 					}
-					if (!ieee->init_wmmparam_flag) /* legacy AP, reset the AC_xx_param register */
-					{
+					/* legacy AP, reset the AC_xx_param register */
+					if (!ieee->init_wmmparam_flag) {
 						queue_work(ieee->wq, &ieee->wmm_param_update_wq);
 						ieee->init_wmmparam_flag = 1; /* indicate AC_xx_param upated since last associate */
 					}
@@ -2087,12 +2069,8 @@  void ieee80211_start_bss(struct ieee80211_device *ieee)
 	 * including a Country IE.
 	 */
 	if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
-	{
 		if (!ieee->bGlobalDomain)
-		{
 			return;
-		}
-	}
 	/* check if we have already found the net we
 	 * are interested in (if any).
 	 * if not (we are disassociated and we are not
@@ -2171,9 +2149,7 @@  static void ieee80211_associate_retry_wq(struct work_struct *work)
 	}
 	/* YJ,add,080828, notify os here */
 	if (ieee->state == IEEE80211_NOLINK)
-	{
 		notify_wx_assoc_event(ieee);
-	}
 	/* YJ,add,080828,end */
 	spin_unlock_irqrestore(&ieee->lock, flags);
 
@@ -2324,9 +2300,8 @@  void ieee80211_softmac_init(struct ieee80211_device *ieee)
 
 	ieee->state = IEEE80211_NOLINK;
 	ieee->sync_scan_hurryup = 0;
-	for (i = 0; i < 5; i++) {
+	for (i = 0; i < 5; i++)
 		ieee->seq_ctrl[i] = 0;
-	}
 
 	ieee->assoc_id = 0;
 	ieee->queue_stop = 0;
@@ -2539,8 +2514,7 @@  static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
 		if (!value) {
 			sec.flags |= SEC_LEVEL;
 			sec.level = SEC_LEVEL_0;
-		}
-		else {
+		} else {
 			sec.flags |= SEC_LEVEL;
 			sec.level = SEC_LEVEL_1;
 		}