Search Linux Wireless

Re: [PATCH] staging: rtl8723au : remove goto & return error directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Gujulan Elango, Hari Prasath (H.)" <hgujulan@xxxxxxxxxxx> writes:
> Remove the goto and return error directly thereby removing a variable
>
> Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx>
> ---
>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

NACK!

The goto is cleaner and more consistent, rather than hiding a return in
the middle of the code.

Jes

>
> diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> index b139ed4..a979048 100644
> --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> @@ -1209,7 +1209,6 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
>  	struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
>  	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
>  	struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
> -	int ret = 0;
>  
>  	DBG_8723A("%s(%s): call netdev_open23a\n", __func__, ndev->name);
>  
> @@ -1238,14 +1237,12 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
>  
>  	if (cfg80211_infrastructure_mode(padapter, type) != _SUCCESS) {
>  		rtw_wdev->iftype = old_type;
> -		ret = -EPERM;
> -		goto exit;
> +		return -EPERM;
>  	}
>  
>  	rtw_setopmode_cmd23a(padapter, type);
>  
> -exit:
> -	return ret;
> +	return 0;
>  }
>  
>  void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux