lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87tudidbiq.fsf@kernel.org>
Date:   Tue, 01 Feb 2022 14:19:57 +0200
From:   Kalle Valo <kvalo@...nel.org>
To:     cgel.zte@...il.com
Cc:     davem@...emloft.net, kuba@...nel.org,
        libertas-dev@...ts.infradead.org, linux-wireless@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] drivers/net/wireless: remove redundant ret variable

cgel.zte@...il.com writes:

> From: Minghao Chi <chi.minghao@....com.cn>
>
> Return value directly instead of taking this in another redundant
> variable.
>
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@...il.com>
> ---
>  drivers/net/wireless/marvell/libertas/cfg.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c
> index 4e3de684928b..f160c258805e 100644
> --- a/drivers/net/wireless/marvell/libertas/cfg.c
> +++ b/drivers/net/wireless/marvell/libertas/cfg.c
> @@ -854,16 +854,13 @@ void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event)
>  static int lbs_remove_wep_keys(struct lbs_private *priv)
>  {
>  	struct cmd_ds_802_11_set_wep cmd;
> -	int ret;
>  
>  	memset(&cmd, 0, sizeof(cmd));
>  	cmd.hdr.size = cpu_to_le16(sizeof(cmd));
>  	cmd.keyindex = cpu_to_le16(priv->wep_tx_key);
>  	cmd.action = cpu_to_le16(CMD_ACT_REMOVE);
>  
> -	ret = lbs_cmd_with_response(priv, CMD_802_11_SET_WEP, &cmd);
> -
> -	return ret;
> +	return lbs_cmd_with_response(priv, CMD_802_11_SET_WEP, &cmd);
>  }
>  
>  /*
> @@ -949,9 +946,7 @@ static int lbs_enable_rsn(struct lbs_private *priv, int enable)
>  	cmd.action = cpu_to_le16(CMD_ACT_SET);
>  	cmd.enable = cpu_to_le16(enable);
>  
> -	ret = lbs_cmd_with_response(priv, CMD_802_11_ENABLE_RSN, &cmd);
> -
> -	return ret;
> +	return lbs_cmd_with_response(priv, CMD_802_11_ENABLE_RSN, &cmd);
>  }

In lbs_enable_rsn() ret variable is now unused.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ