From: cgel.zte@gmail.com
To: kvalo@kernel.org
Cc: davem@davemloft.net, kuba@kernel.org,
libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>, CGEL ZTE <cgel.zte@gmail.com>
Subject: [PATCH] drivers/net/wireless: remove redundant ret variable
Date: Wed, 12 Jan 2022 08:07:15 +0000 [thread overview]
Message-ID: <20220112080715.667254-1-chi.minghao@zte.com.cn> (raw)
From: Minghao Chi <chi.minghao@zte.com.cn>
Return value directly instead of taking this in another redundant
variable.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.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);
}
@@ -976,7 +971,6 @@ static int lbs_set_key_material(struct lbs_private *priv,
const u8 *key, u16 key_len)
{
struct cmd_key_material cmd;
- int ret;
/*
* Example for WPA (TKIP):
@@ -1004,9 +998,7 @@ static int lbs_set_key_material(struct lbs_private *priv,
if (key && key_len)
memcpy(cmd.param.key, key, key_len);
- ret = lbs_cmd_with_response(priv, CMD_802_11_KEY_MATERIAL, &cmd);
-
- return ret;
+ return lbs_cmd_with_response(priv, CMD_802_11_KEY_MATERIAL, &cmd);
}
--
2.25.1
next reply other threads:[~2022-01-12 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 8:07 cgel.zte [this message]
2022-01-12 8:16 ` Kalle Valo
2022-02-01 12:19 ` Kalle Valo
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=20220112080715.667254-1-chi.minghao@zte.com.cn \
--to=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=zealci@zte.com.cn \
/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®