[OPW,kernel,v2,04/24] staging: rtl8187se: Re-write if statement with comment lines inside.
diff mbox

Message ID 8a4ed188f91f05d89eecec0dc1067942c64015a7.1394827592.git.anarey@gmail.com
State New, archived
Headers show

Commit Message

Ana Rey March 14, 2014, 8:15 p.m. UTC
I deleted comment lines inside of if-statement (between 'if' and
condition) and I added them on the top of the if-statement.

Also, I deleted an unnecessary whitespace in these lines.

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

Comments

Bob Copeland March 15, 2014, 8:19 p.m. UTC | #1
On Fri, Mar 14, 2014 at 09:15:55PM +0100, Ana Rey wrote:
> I deleted comment lines inside of if-statement (between 'if' and
> condition) and I added them on the top of the if-statement.
> 
> Also, I deleted an unnecessary whitespace in these lines.

Please don't use first person here.  Instead, something like:

    Move comments from inside if conditionals to the lines
    above the if-statement.  Also delete unnecessary whitespace
    in these lines.

> -		if (	/* if the user set the AP check if match.
> -			 * if the network does not broadcast essid we check the user supplied ANY essid
> -			 * if the network does broadcast and the user does not set essid it is OK
> -			 * if the network does broadcast and the user did set essid chech if essid match
> -			 */
> -				( apset && apmatch &&
> -				  ((ssidset && ssidbroad && ssidmatch) || (ssidbroad && !ssidset) || (!ssidbroad && ssidset)) ) ||
> -				/* if the ap is not set, check that the user set the bssid
> -				 * and the network does broadcast and that those two bssid matches
> -				 */
> -				(!apset && ssidset && ssidbroad && ssidmatch)
> -		   ){
> +		/* if the user set the AP check if match.
> +		 * if the network does not broadcast essid we check the user
> +		 * supplied ANY essid
> +		 * if the network does broadcast and the user does not set essid
> +		 * it is OK
> +		 * if the network does broadcast and the user did set essid
> +		 * chech if essid match
> +		 * (apset && apmatch && ((ssidset && ssidbroad && ssidmatch) ||
> +		 *  (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) ||

What happened here?

> +		 * if the ap is not set, check that the user set the bssid and
> +		 * the network does broadcast and that those two bssid matches
> +		 * (!apset && ssidset && ssidbroad && ssidmatch)
> +		 */

Patch
diff mbox

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index 0543b1f..afbc94f 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -1224,18 +1224,22 @@  inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
 		else
 			ssidmatch = (0==strncmp(ieee->current_network.ssid, net->ssid, net->ssid_len));
 
-		if (	/* if the user set the AP check if match.
-			 * if the network does not broadcast essid we check the user supplied ANY essid
-			 * if the network does broadcast and the user does not set essid it is OK
-			 * if the network does broadcast and the user did set essid chech if essid match
-			 */
-				( apset && apmatch &&
-				  ((ssidset && ssidbroad && ssidmatch) || (ssidbroad && !ssidset) || (!ssidbroad && ssidset)) ) ||
-				/* if the ap is not set, check that the user set the bssid
-				 * and the network does broadcast and that those two bssid matches
-				 */
-				(!apset && ssidset && ssidbroad && ssidmatch)
-		   ){
+		/* if the user set the AP check if match.
+		 * if the network does not broadcast essid we check the user
+		 * supplied ANY essid
+		 * if the network does broadcast and the user does not set essid
+		 * it is OK
+		 * if the network does broadcast and the user did set essid
+		 * chech if essid match
+		 * (apset && apmatch && ((ssidset && ssidbroad && ssidmatch) ||
+		 *  (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) ||
+		 * if the ap is not set, check that the user set the bssid and
+		 * the network does broadcast and that those two bssid matches
+		 * (!apset && ssidset && ssidbroad && ssidmatch)
+		 */
+		if ((apset && apmatch && ((ssidset && ssidbroad && ssidmatch) ||
+		     (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) ||
+		    (!apset && ssidset && ssidbroad && ssidmatch)) {
 			/* if the essid is hidden replace it with the
 			 * essid provided by the user.
 			 */
@@ -1685,7 +1689,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 */