diff mbox series

rtlwifi: btcoex: fix issue possible condition with no effect (if == else)

Message ID 20190712191535.GA4215@hari-Inspiron-1545 (mailing list archive)
State Accepted
Commit 9a29f7d8476c143ddbb9ecca614b66d2842c25d8
Delegated to: Kalle Valo
Headers show
Series rtlwifi: btcoex: fix issue possible condition with no effect (if == else) | expand

Commit Message

Hariprasad Kelam July 12, 2019, 7:15 p.m. UTC
fix below issue reported by coccicheck
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:514:1-3:
WARNING: possible condition with no effect (if == else)

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Ping-Ke Shih July 18, 2019, 2:45 a.m. UTC | #1
On Fri, 2019-07-12 at 19:15 +0000, Hariprasad Kelam wrote:
> fix below issue reported by coccicheck
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:514:1-3:
> WARNING: possible condition with no effect (if == else)
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> index 152242a..191dafd0 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -509,13 +509,7 @@ static u32 halbtc_get_wifi_link_status(struct btc_coexist
> *btcoexist)
>  
>  static s32 halbtc_get_wifi_rssi(struct rtl_priv *rtlpriv)
>  {
> -	int undec_sm_pwdb = 0;
> -
> -	if (rtlpriv->mac80211.link_state >= MAC80211_LINKED)
> -		undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb;
> -	else /* associated entry pwdb */
> -		undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb;
> -	return undec_sm_pwdb;
> +	return rtlpriv->dm.undec_sm_pwdb;
>  }
>  
>  static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)

It looks good to me. Thank you.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Kalle Valo July 24, 2019, 11:52 a.m. UTC | #2
Hariprasad Kelam <hariprasad.kelam@gmail.com> wrote:

> fix below issue reported by coccicheck
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:514:1-3:
> WARNING: possible condition with no effect (if == else)
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

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

9a29f7d8476c rtlwifi: btcoex: fix issue possible condition with no effect (if == else)
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 152242a..191dafd0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -509,13 +509,7 @@  static u32 halbtc_get_wifi_link_status(struct btc_coexist *btcoexist)
 
 static s32 halbtc_get_wifi_rssi(struct rtl_priv *rtlpriv)
 {
-	int undec_sm_pwdb = 0;
-
-	if (rtlpriv->mac80211.link_state >= MAC80211_LINKED)
-		undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb;
-	else /* associated entry pwdb */
-		undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb;
-	return undec_sm_pwdb;
+	return rtlpriv->dm.undec_sm_pwdb;
 }
 
 static bool halbtc_get(void *void_btcoexist, u8 get_type, void *out_buf)