diff mbox series

[3/6] rtlwifi: rtl8192ee: Remove set but not used variable 'err'

Message ID 1569833692-93288-4-git-send-email-zhengbin13@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series rtlwifi: Remove a bunch of set but not used variables | expand

Commit Message

Zheng Bin Sept. 30, 2019, 8:54 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c: In function rtl92ee_download_fw:
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c:111:6: warning: variable err set but not used [-Wunused-but-set-variable]

It is not used since commit c93ac39da006 ("rtlwifi:
Remove some redundant code")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.7.4

Comments

Ping-Ke Shih Oct. 1, 2019, 9:38 a.m. UTC | #1
> -----Original Message-----
> From: linux-wireless-owner@vger.kernel.org [mailto:linux-wireless-owner@vger.kernel.org] On Behalf
> Of zhengbin
> Sent: Monday, September 30, 2019 4:55 PM
> To: Pkshih; kvalo@codeaurora.org; davem@davemloft.net; linux-wireless@vger.kernel.org;
> netdev@vger.kernel.org
> Cc: zhengbin13@huawei.com
> Subject: [PATCH 3/6] rtlwifi: rtl8192ee: Remove set but not used variable 'err'
> 
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c: In function rtl92ee_download_fw:
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c:111:6: warning: variable err set but not used
> [-Wunused-but-set-variable]
> 
> It is not used since commit c93ac39da006 ("rtlwifi:
> Remove some redundant code")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> index 67305ce..322798c 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
> @@ -108,7 +108,6 @@ int rtl92ee_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw)
>  	struct rtlwifi_firmware_header *pfwheader;
>  	u8 *pfwdata;
>  	u32 fwsize;
> -	int err;
>  	enum version_8192e version = rtlhal->version;
> 
>  	if (!rtlhal->pfirmware)
> @@ -146,7 +145,7 @@ int rtl92ee_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw)
>  	_rtl92ee_write_fw(hw, version, pfwdata, fwsize);
>  	_rtl92ee_enable_fw_download(hw, false);
> 
> -	err = _rtl92ee_fw_free_to_go(hw);
> +	(void)_rtl92ee_fw_free_to_go(hw);
> 
>  	return 0;

After checking the flow, it's ok 'return _rtl92ee_fw_free_to_go(hw);'.

>  }
> --
> 2.7.4
> 
> 
> ------Please consider the environment before printing this e-mail.
Kalle Valo Oct. 2, 2019, 4:26 a.m. UTC | #2
zhengbin <zhengbin13@huawei.com> wrote:

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c: In function rtl92ee_download_fw:
> drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c:111:6: warning: variable err set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit c93ac39da006 ("rtlwifi:
> Remove some redundant code")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Dropping this patch per Ping's comment, please fix and resend this
patch.

Patch set to Changes Requested.
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index 67305ce..322798c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -108,7 +108,6 @@  int rtl92ee_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw)
 	struct rtlwifi_firmware_header *pfwheader;
 	u8 *pfwdata;
 	u32 fwsize;
-	int err;
 	enum version_8192e version = rtlhal->version;

 	if (!rtlhal->pfirmware)
@@ -146,7 +145,7 @@  int rtl92ee_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw)
 	_rtl92ee_write_fw(hw, version, pfwdata, fwsize);
 	_rtl92ee_enable_fw_download(hw, false);

-	err = _rtl92ee_fw_free_to_go(hw);
+	(void)_rtl92ee_fw_free_to_go(hw);

 	return 0;
 }