diff mbox series

rtlwifi: btcoex: remove redundant initialization of variables ant_num and single_ant_path

Message ID 20200723163214.995226-1-colin.king@canonical.com (mailing list archive)
State Accepted
Commit 56b06d4da8128a73dd1568cf65cb57725cc71968
Delegated to: Kalle Valo
Headers show
Series rtlwifi: btcoex: remove redundant initialization of variables ant_num and single_ant_path | expand

Commit Message

Colin King July 23, 2020, 4:32 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variables ant_num and single_ant_path are being initialized with a
value that is never read and are being updated later with a new value.
The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ping-Ke Shih July 24, 2020, 5:14 a.m. UTC | #1
On Thu, 2020-07-23 at 17:32 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variables ant_num and single_ant_path are being initialized with a
> value that is never read and are being updated later with a new value.
> The initializations are redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Thank you

> ---
>  drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> index a4940a3842de..4949f99844b5 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -1318,7 +1318,7 @@ bool exhalbtc_bind_bt_coex_withadapter(void *adapter)
>  {
>  	struct rtl_priv *rtlpriv = adapter;
>  	struct btc_coexist *btcoexist = rtl_btc_coexist(rtlpriv);
> -	u8 ant_num = 2, chip_type, single_ant_path = 0;
> +	u8 ant_num, chip_type, single_ant_path;
>  
>  	if (!btcoexist)
>  		return false;
Kalle Valo Aug. 2, 2020, 2:54 p.m. UTC | #2
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variables ant_num and single_ant_path are being initialized with a
> value that is never read and are being updated later with a new value.
> The initializations are redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-drivers-next.git, thanks.

56b06d4da812 rtlwifi: btcoex: remove redundant initialization of variables ant_num and single_ant_path
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index a4940a3842de..4949f99844b5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -1318,7 +1318,7 @@  bool exhalbtc_bind_bt_coex_withadapter(void *adapter)
 {
 	struct rtl_priv *rtlpriv = adapter;
 	struct btc_coexist *btcoexist = rtl_btc_coexist(rtlpriv);
-	u8 ant_num = 2, chip_type, single_ant_path = 0;
+	u8 ant_num, chip_type, single_ant_path;
 
 	if (!btcoexist)
 		return false;