Re: [PATCH] Staging: rtl8723bs: os_dep: Remove unneeded variable for return

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

 



On Sat, May 18, 2019 at 12:22:47PM +0530, Puranjay Mohan wrote:
> Remove unneeded variable "ret" and directly return 0 in functions.
> Fix following coccicheck warning:
> Unneeded variable: "ret". Return "0".
> 
> Signed-off-by: Puranjay Mohan <puranjay12@xxxxxxxxx>
> ---
>  drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> index db553f2e4c0b..b105ba698d55 100644
> --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> @@ -2441,20 +2441,18 @@ void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned char
>  
>  static int rtw_cfg80211_monitor_if_open(struct net_device *ndev)
>  {
> -	int ret = 0;
>  
>  	DBG_8192C("%s\n", __func__);
>  
> -	return ret;
> +	return 0;
>  }

As this function does nothing, it should just be removed.

>  
>  static int rtw_cfg80211_monitor_if_close(struct net_device *ndev)
>  {
> -	int ret = 0;
>  
>  	DBG_8192C("%s\n", __func__);
>  
> -	return ret;
> +	return 0;
>  }

Same here.

>  
>  static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
> @@ -2606,11 +2604,10 @@ static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc
>  
>  static int rtw_cfg80211_monitor_if_set_mac_address(struct net_device *ndev, void *addr)
>  {
> -	int ret = 0;
>  
>  	DBG_8192C("%s\n", __func__);
>  
> -	return ret;
> +	return 0;
>  }

This should also be removed, as it does nothing, and it is faking out
the network core to say it really does support this option, but it does
not, which is not good at all.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux