mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Phillip Potter <phil@philpotter.co.uk>, gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, paskripkin@gmail.com,
	straube.linux@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: r8188eu: change return type of rtw_set_802_11_disassociate to void
Date: Fri, 4 Nov 2022 19:21:52 +0100	[thread overview]
Message-ID: <754301ee-c430-60ff-1c87-ba96fd032550@gmail.com> (raw)
In-Reply-To: <20221103230632.6946-1-phil@philpotter.co.uk>

On 11/4/22 00:06, Phillip Potter wrote:
> Change return type of rtw_set_802_11_disassociate to void. This function
> always returns 'true' no matter what, so there is no need to return a
> value, and no need to check for it in the two call sites within
> rtw_wx_set_mlme. Also, as we are no longer using ret in rtw_wx_set_mlme
> except as the return value, just remove it and return 0 directly.
> 
> Suggested-by: Michael Straube <straube.linux@gmail.com>
> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> ---
> 
> Changes from V1: Act on feedback from Michael Straube:
> * Remove ret variable from rtw_wx_set_mlme and return 0 directly in
>    success case.
> 
> ---
>   drivers/staging/r8188eu/core/rtw_ioctl_set.c    | 4 +---
>   drivers/staging/r8188eu/include/rtw_ioctl_set.h | 2 +-
>   drivers/staging/r8188eu/os_dep/ioctl_linux.c    | 9 +++------
>   3 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> index 786431826659..785c0dba508f 100644
> --- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> +++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> @@ -314,7 +314,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
>   	return true;
>   }
>   
> -u8 rtw_set_802_11_disassociate(struct adapter *padapter)
> +void rtw_set_802_11_disassociate(struct adapter *padapter)
>   {
>   	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>   
> @@ -328,8 +328,6 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
>   	}
>   
>   	spin_unlock_bh(&pmlmepriv->lock);
> -
> -	return true;
>   }
>   
>   u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
> diff --git a/drivers/staging/r8188eu/include/rtw_ioctl_set.h b/drivers/staging/r8188eu/include/rtw_ioctl_set.h
> index abe460d6504d..c3eb2479f27b 100644
> --- a/drivers/staging/r8188eu/include/rtw_ioctl_set.h
> +++ b/drivers/staging/r8188eu/include/rtw_ioctl_set.h
> @@ -12,7 +12,7 @@ u8 rtw_set_802_11_authentication_mode(struct adapter *adapt,
>   				      enum ndis_802_11_auth_mode authmode);
>   u8 rtw_set_802_11_bssid(struct adapter *adapter, u8 *bssid);
>   u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep);
> -u8 rtw_set_802_11_disassociate(struct adapter *adapter);
> +void rtw_set_802_11_disassociate(struct adapter *adapter);
>   u8 rtw_set_802_11_bssid_list_scan(struct adapter *adapter,
>   				  struct ndis_802_11_ssid *pssid,
>   				  int ssid_max_num);
> diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> index dda48a2a6d0c..8e9b7b0664bc 100644
> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> @@ -1011,7 +1011,6 @@ static int rtw_wx_set_mlme(struct net_device *dev,
>   			     struct iw_request_info *info,
>   			     union iwreq_data *wrqu, char *extra)
>   {
> -	int ret = 0;
>   	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
>   	struct iw_mlme *mlme = (struct iw_mlme *)extra;
>   
> @@ -1020,17 +1019,15 @@ static int rtw_wx_set_mlme(struct net_device *dev,
>   
>   	switch (mlme->cmd) {
>   	case IW_MLME_DEAUTH:
> -		if (!rtw_set_802_11_disassociate(padapter))
> -			ret = -1;
> +		rtw_set_802_11_disassociate(padapter);
>   		break;
>   	case IW_MLME_DISASSOC:
> -		if (!rtw_set_802_11_disassociate(padapter))
> -			ret = -1;
> +		rtw_set_802_11_disassociate(padapter);
>   		break;
>   	default:
>   		return -EOPNOTSUPP;
>   	}
> -	return ret;
> +	return 0;
>   }
>   
>   static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150

      reply	other threads:[~2022-11-04 18:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 23:06 Phillip Potter
2022-11-04 18:21 ` Philipp Hortmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=754301ee-c430-60ff-1c87-ba96fd032550@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®