diff mbox

[OPW,kernel,08/11] staging: rtl8187se: Fixed errors: 'do not use assignment in if condition' in ieee80211/ieee80211_softmac.c

Message ID cf96bf138ae65fe68c7b4fda6c5ca501a06a2cd1.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 the following checkpatch.pl error in
ieee80211/ieee80211_softmac.c

'ERROR: do not use assignment in if condition'

Signed-off-by: Ana Rey <anarey@gmail.com>
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Sarah Sharp March 8, 2014, 12:02 a.m. UTC | #1
On Fri, Mar 07, 2014 at 01:33:08PM +0100, Ana Rey wrote:
> This patch fixes the following checkpatch.pl error in
> ieee80211/ieee80211_softmac.c
> 
> 'ERROR: do not use assignment in if condition'
> 
> Signed-off-by: Ana Rey <anarey@gmail.com>
> ---
>  drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> index e1815b4..7627ca6 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> @@ -1645,7 +1645,8 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  		if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
>  			ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED &&
>  			ieee->iw_mode == IW_MODE_INFRA) {
> -			if (0 == (errcode = assoc_parse(skb, &aid))) {
> +			errcode = assoc_parse(skb, &aid);
> +			if (0 == errcode) {

Instead, do:

+			errcode = assoc_parse(skb, &aid);
+			if (!errcode) {



>  				u16 left;
>  
>  				ieee->state = IEEE80211_LINKED;
> @@ -1729,8 +1730,8 @@ associate_complete:
>  				ieee->iw_mode == IW_MODE_INFRA){
>  
>  				IEEE80211_DEBUG_MGMT("Received authentication response");
> -
> -				if (0 == (errcode = auth_parse(skb, &challenge, &chlen))) {
> +				errcode = auth_parse(skb, &challenge, &chlen);
> +				if (0 == errcode) {

Same here.

Sarah Sharp

>  					if (ieee->open_wep || !challenge) {
>  						ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED;
>  						ieee->softmac_stats.rx_auth_rs_ok++;
> -- 
> 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.
Ana Rey March 10, 2014, 7:58 a.m. UTC | #2
I reject this patch because other patch was accepted with a similar change.

https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-next&id=e839c42d0b8789edc9814b69dcbedd3e1ad7c544

Thanks Sarah for your advice :)

Ana

2014-03-08 1:02 GMT+01:00 Sarah Sharp <sarah.a.sharp@intel.com>:
> On Fri, Mar 07, 2014 at 01:33:08PM +0100, Ana Rey wrote:
>> This patch fixes the following checkpatch.pl error in
>> ieee80211/ieee80211_softmac.c
>>
>> 'ERROR: do not use assignment in if condition'
>>
>> Signed-off-by: Ana Rey <anarey@gmail.com>
>> ---
>>  drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
>> index e1815b4..7627ca6 100644
>> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
>> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
>> @@ -1645,7 +1645,8 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>>               if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
>>                       ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED &&
>>                       ieee->iw_mode == IW_MODE_INFRA) {
>> -                     if (0 == (errcode = assoc_parse(skb, &aid))) {
>> +                     errcode = assoc_parse(skb, &aid);
>> +                     if (0 == errcode) {
>
> Instead, do:
>
> +                       errcode = assoc_parse(skb, &aid);
> +                       if (!errcode) {
>
>
>
>>                               u16 left;
>>
>>                               ieee->state = IEEE80211_LINKED;
>> @@ -1729,8 +1730,8 @@ associate_complete:
>>                               ieee->iw_mode == IW_MODE_INFRA){
>>
>>                               IEEE80211_DEBUG_MGMT("Received authentication response");
>> -
>> -                             if (0 == (errcode = auth_parse(skb, &challenge, &chlen))) {
>> +                             errcode = auth_parse(skb, &challenge, &chlen);
>> +                             if (0 == errcode) {
>
> Same here.
>
> Sarah Sharp
>
>>                                       if (ieee->open_wep || !challenge) {
>>                                               ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED;
>>                                               ieee->softmac_stats.rx_auth_rs_ok++;
>> --
>> 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.
>
> --
> 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 e1815b4..7627ca6 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -1645,7 +1645,8 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 		if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
 			ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED &&
 			ieee->iw_mode == IW_MODE_INFRA) {
-			if (0 == (errcode = assoc_parse(skb, &aid))) {
+			errcode = assoc_parse(skb, &aid);
+			if (0 == errcode) {
 				u16 left;
 
 				ieee->state = IEEE80211_LINKED;
@@ -1729,8 +1730,8 @@  associate_complete:
 				ieee->iw_mode == IW_MODE_INFRA){
 
 				IEEE80211_DEBUG_MGMT("Received authentication response");
-
-				if (0 == (errcode = auth_parse(skb, &challenge, &chlen))) {
+				errcode = auth_parse(skb, &challenge, &chlen);
+				if (0 == errcode) {
 					if (ieee->open_wep || !challenge) {
 						ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED;
 						ieee->softmac_stats.rx_auth_rs_ok++;