be7b70ab5f2b9e5c302e74052753b9659de7cceb
[openwrt/staging/thess.git] / package / kernel / rtl8812au-ct / patches / 007-treewide-fix-always-TRUE-condition-warning.patch
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
5
6 Fix always TRUE condition warning an drop redundant check.
7
8 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
9 ---
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(-)
14
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 *
18 {
19 _func_enter_;
20
21 - if(&psta->lock != NULL)
22 - _rtw_spinlock_free(&psta->lock);
23 + _rtw_spinlock_free(&psta->lock);
24
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(
30 case PHYDM_RA:
31
32 for(i=0; i<5; i++) {
33 - if(input[i+1]) {
34 - PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]);
35 + PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]);
36
37 - PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));
38 - input_idx++;
39 - }
40 + PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));
41 + input_idx++;
42 }
43
44 if(input_idx>=1) {
45 @@ -891,12 +889,10 @@ phydm_cmd_parser(
46 case PHYDM_PATHDIV:
47
48 for(i=0; i<5; i++) {
49 - if(input[i+1]) {
50 - PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]);
51 + PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]);
52
53 - PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));
54 - input_idx++;
55 - }
56 + PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));
57 + input_idx++;
58 }
59
60 if(input_idx>=1) {
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
64
65 #ifdef CONFIG_P2P
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)
71 ) {
72 if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {