1 From dc4024894c9deefc56f8dd6b2d2822b277f268a5 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Sun, 30 Jul 2023 11:18:48 +0200
4 Subject: [PATCH 2/5] treewide: fix always TRUE condition warning
6 Fix always TRUE condition warning an drop redundant check.
8 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
10 core/rtw_sta_mgt.c | 3 +--
11 hal/OUTSRC/phydm_debug.c | 16 ++++++----------
12 os_dep/linux/ioctl_cfg80211.c | 3 +--
13 3 files changed, 8 insertions(+), 14 deletions(-)
15 --- a/core/rtw_sta_mgt.c
16 +++ b/core/rtw_sta_mgt.c
17 @@ -207,8 +207,7 @@ void rtw_mfree_stainfo(struct sta_info *
21 - if(&psta->lock != NULL)
22 - _rtw_spinlock_free(&psta->lock);
23 + _rtw_spinlock_free(&psta->lock);
25 _rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
26 _rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
27 --- a/hal/OUTSRC/phydm_debug.c
28 +++ b/hal/OUTSRC/phydm_debug.c
29 @@ -870,12 +870,10 @@ phydm_cmd_parser(
34 - PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]);
35 + PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]);
37 - PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));
40 + PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));
45 @@ -891,12 +889,10 @@ phydm_cmd_parser(
50 - PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]);
51 + PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]);
53 - PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));
56 + PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));
61 --- a/os_dep/linux/ioctl_cfg80211.c
62 +++ b/os_dep/linux/ioctl_cfg80211.c
63 @@ -2170,8 +2170,7 @@ static int cfg80211_rtw_scan(struct wiph
66 if( pwdinfo->driver_interface == DRIVER_CFG80211 ) {
67 - if(ssids->ssid != NULL
68 - && _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
69 + if(_rtw_memcmp(ssids->ssid, "DIRECT-", 7)
70 && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
72 if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {