[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB7PR04MB4538A2B9B59010BBD3261FB3FC6A9@DB7PR04MB4538.eurprd04.prod.outlook.com>
Date: Wed, 17 Mar 2021 07:25:11 +0000
From: Sharvari Harisangam <sharvari.harisangam@....com>
To: "zuoqilin1@....com" <zuoqilin1@....com>,
"amitkarwar@...il.com" <amitkarwar@...il.com>,
"ganapathi017@...il.com" <ganapathi017@...il.com>,
"huxinming820@...il.com" <huxinming820@...il.com>,
"kvalo@...eaurora.org" <kvalo@...eaurora.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>
CC: "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
zuoqilin <zuoqilin@...ong.com>
Subject: RE: [EXT] [PATCH] mwifiex: Remove redundant assignment
We need to return 0 in success case. So this can't be removed.
> -----Original Message-----
> From: zuoqilin1@....com <zuoqilin1@....com>
> Sent: Wednesday, March 17, 2021 11:40 AM
> To: amitkarwar@...il.com; ganapathi017@...il.com; Sharvari Harisangam
> <sharvari.harisangam@....com>; huxinming820@...il.com;
> kvalo@...eaurora.org; davem@...emloft.net; kuba@...nel.org
> Cc: linux-wireless@...r.kernel.org; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; zuoqilin <zuoqilin@...ong.com>
> Subject: [EXT] [PATCH] mwifiex: Remove redundant assignment
>
> Caution: EXT Email
>
> From: zuoqilin <zuoqilin@...ong.com>
>
> There is no need to define the err variable, and then assign -EINVAL, we can
> directly return -EINVAL.
>
> Signed-off-by: zuoqilin <zuoqilin@...ong.com>
> ---
> drivers/net/wireless/marvell/mwifiex/ie.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/ie.c
> b/drivers/net/wireless/marvell/mwifiex/ie.c
> index 40e99ea..c88213c 100644
> --- a/drivers/net/wireless/marvell/mwifiex/ie.c
> +++ b/drivers/net/wireless/marvell/mwifiex/ie.c
> @@ -333,7 +333,6 @@ static int mwifiex_uap_parse_tail_ies(struct
> mwifiex_private *priv,
> u16 gen_idx = MWIFIEX_AUTO_IDX_MASK, ie_len = 0;
> int left_len, parsed_len = 0;
> unsigned int token_len;
> - int err = 0;
>
> if (!info->tail || !info->tail_len)
> return 0;
> @@ -351,7 +350,6 @@ static int mwifiex_uap_parse_tail_ies(struct
> mwifiex_private *priv,
> hdr = (void *)(info->tail + parsed_len);
> token_len = hdr->len + sizeof(struct ieee_types_header);
> if (token_len > left_len) {
> - err = -EINVAL;
> goto out;
> }
>
> @@ -377,7 +375,6 @@ static int mwifiex_uap_parse_tail_ies(struct
> mwifiex_private *priv,
> fallthrough;
> default:
> if (ie_len + token_len > IEEE_MAX_IE_SIZE) {
> - err = -EINVAL;
> goto out;
> }
> memcpy(gen_ie->ie_buffer + ie_len, hdr, token_len); @@ -397,7
> +394,6 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,
> if (vendorhdr) {
> token_len = vendorhdr->len + sizeof(struct ieee_types_header);
> if (ie_len + token_len > IEEE_MAX_IE_SIZE) {
> - err = -EINVAL;
> goto out;
> }
> memcpy(gen_ie->ie_buffer + ie_len, vendorhdr, token_len); @@ -415,7
> +411,6 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,
>
> if (mwifiex_update_uap_custom_ie(priv, gen_ie, &gen_idx, NULL, NULL,
> NULL, NULL)) {
> - err = -EINVAL;
> goto out;
> }
>
> @@ -423,7 +418,7 @@ static int mwifiex_uap_parse_tail_ies(struct
> mwifiex_private *priv,
>
> out:
> kfree(gen_ie);
> - return err;
> + return -EINVAL;
> }
>
> /* This function parses different IEs-head & tail IEs, beacon IEs,
> --
> 1.9.1
Powered by blists - more mailing lists