diff mbox

[-next] ipw2200: return error code on error in ipw_wx_get_auth()

Message ID CAPgLHd-k+RY5m804tBg4uzbWsUhS16coW9cQ62R7mPCjKjGffg@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Wei Yongjun Dec. 4, 2012, 6:03 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

We have assinged error code to 'ret' when get auth from some
option is not supported but never used it, but we'd better return
the error code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/wireless/ipw2x00/ipw2200.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



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

Comments

Stanislav Yakovlev Dec. 5, 2012, 6:55 a.m. UTC | #1
Hello, Wei,

On 3 December 2012 22:03, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> We have assinged error code to 'ret' when get auth from some
> option is not supported but never used it, but we'd better return
> the error code.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/net/wireless/ipw2x00/ipw2200.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index 482f505..1ad72d5 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -6812,7 +6812,6 @@ static int ipw_wx_get_auth(struct net_device *dev,
>         struct libipw_device *ieee = priv->ieee;
>         struct lib80211_crypt_data *crypt;
>         struct iw_param *param = &wrqu->param;
> -       int ret = 0;
>
>         switch (param->flags & IW_AUTH_INDEX) {
>         case IW_AUTH_WPA_VERSION:
> @@ -6822,7 +6821,7 @@ static int ipw_wx_get_auth(struct net_device *dev,
>                 /*
>                  * wpa_supplicant will control these internally
>                  */
> -               ret = -EOPNOTSUPP;
> +               return -EOPNOTSUPP;
>                 break;

Could you remove this break as well?

Thanks,
Stanislav.

>
>         case IW_AUTH_TKIP_COUNTERMEASURES:
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wei Yongjun Dec. 5, 2012, 8:08 a.m. UTC | #2
On 12/05/2012 02:55 PM, Stanislav Yakovlev wrote:
> Hello, Wei,
>
> On 3 December 2012 22:03, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> We have assinged error code to 'ret' when get auth from some
>> option is not supported but never used it, but we'd better return
>> the error code.
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>> ---
>>  drivers/net/wireless/ipw2x00/ipw2200.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
>> index 482f505..1ad72d5 100644
>> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
>> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
>> @@ -6812,7 +6812,6 @@ static int ipw_wx_get_auth(struct net_device *dev,
>>         struct libipw_device *ieee = priv->ieee;
>>         struct lib80211_crypt_data *crypt;
>>         struct iw_param *param = &wrqu->param;
>> -       int ret = 0;
>>
>>         switch (param->flags & IW_AUTH_INDEX) {
>>         case IW_AUTH_WPA_VERSION:
>> @@ -6822,7 +6821,7 @@ static int ipw_wx_get_auth(struct net_device *dev,
>>                 /*
>>                  * wpa_supplicant will control these internally
>>                  */
>> -               ret = -EOPNOTSUPP;
>> +               return -EOPNOTSUPP;
>>                 break;
> Could you remove this break as well?

My mistake, I will send a update patch soon.

Regards,
Yongjun Wei

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

Patch

diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 482f505..1ad72d5 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -6812,7 +6812,6 @@  static int ipw_wx_get_auth(struct net_device *dev,
 	struct libipw_device *ieee = priv->ieee;
 	struct lib80211_crypt_data *crypt;
 	struct iw_param *param = &wrqu->param;
-	int ret = 0;
 
 	switch (param->flags & IW_AUTH_INDEX) {
 	case IW_AUTH_WPA_VERSION:
@@ -6822,7 +6821,7 @@  static int ipw_wx_get_auth(struct net_device *dev,
 		/*
 		 * wpa_supplicant will control these internally
 		 */
-		ret = -EOPNOTSUPP;
+		return -EOPNOTSUPP;
 		break;
 
 	case IW_AUTH_TKIP_COUNTERMEASURES: