Commit 6016f0cb authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Kalle Valo

wifi: rtlwifi: cleanup few rtlxxxx_set_hw_reg() routines

Since 'u8' comparison against zero is always false, drop the
corresponding branches of AMPDU_MIN_SPACE adjustment within
'rtlxxxx_set_hw_reg()' for rtl8188ee, rtl8192ce, rtl8192de,
rtl8723ae, rtl8723be, and rtl8821ae. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Acked-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230925090452.25633-1-dmantipov@yandex.ru
parent 8e73c045
...@@ -433,14 +433,9 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -433,14 +433,9 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break; break;
case HW_VAR_AMPDU_MIN_SPACE:{ case HW_VAR_AMPDU_MIN_SPACE:{
u8 min_spacing_to_set; u8 min_spacing_to_set;
u8 sec_min_space;
min_spacing_to_set = *val; min_spacing_to_set = *val;
if (min_spacing_to_set <= 7) { if (min_spacing_to_set <= 7) {
sec_min_space = 0;
if (min_spacing_to_set < sec_min_space)
min_spacing_to_set = sec_min_space;
mac->min_space_cfg = ((mac->min_space_cfg & mac->min_space_cfg = ((mac->min_space_cfg &
0xf8) | 0xf8) |
......
...@@ -208,14 +208,9 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -208,14 +208,9 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
} }
case HW_VAR_AMPDU_MIN_SPACE:{ case HW_VAR_AMPDU_MIN_SPACE:{
u8 min_spacing_to_set; u8 min_spacing_to_set;
u8 sec_min_space;
min_spacing_to_set = *val; min_spacing_to_set = *val;
if (min_spacing_to_set <= 7) { if (min_spacing_to_set <= 7) {
sec_min_space = 0;
if (min_spacing_to_set < sec_min_space)
min_spacing_to_set = sec_min_space;
mac->min_space_cfg = ((mac->min_space_cfg & mac->min_space_cfg = ((mac->min_space_cfg &
0xf8) | 0xf8) |
......
...@@ -225,13 +225,9 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -225,13 +225,9 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
} }
case HW_VAR_AMPDU_MIN_SPACE: { case HW_VAR_AMPDU_MIN_SPACE: {
u8 min_spacing_to_set; u8 min_spacing_to_set;
u8 sec_min_space;
min_spacing_to_set = *val; min_spacing_to_set = *val;
if (min_spacing_to_set <= 7) { if (min_spacing_to_set <= 7) {
sec_min_space = 0;
if (min_spacing_to_set < sec_min_space)
min_spacing_to_set = sec_min_space;
mac->min_space_cfg = ((mac->min_space_cfg & 0xf8) | mac->min_space_cfg = ((mac->min_space_cfg & 0xf8) |
min_spacing_to_set); min_spacing_to_set);
*val = min_spacing_to_set; *val = min_spacing_to_set;
......
...@@ -212,14 +212,9 @@ void rtl8723e_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -212,14 +212,9 @@ void rtl8723e_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
} }
case HW_VAR_AMPDU_MIN_SPACE:{ case HW_VAR_AMPDU_MIN_SPACE:{
u8 min_spacing_to_set; u8 min_spacing_to_set;
u8 sec_min_space;
min_spacing_to_set = *((u8 *)val); min_spacing_to_set = *((u8 *)val);
if (min_spacing_to_set <= 7) { if (min_spacing_to_set <= 7) {
sec_min_space = 0;
if (min_spacing_to_set < sec_min_space)
min_spacing_to_set = sec_min_space;
mac->min_space_cfg = ((mac->min_space_cfg & mac->min_space_cfg = ((mac->min_space_cfg &
0xf8) | 0xf8) |
......
...@@ -468,15 +468,9 @@ void rtl8723be_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -468,15 +468,9 @@ void rtl8723be_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break; break;
case HW_VAR_AMPDU_MIN_SPACE:{ case HW_VAR_AMPDU_MIN_SPACE:{
u8 min_spacing_to_set; u8 min_spacing_to_set;
u8 sec_min_space;
min_spacing_to_set = *((u8 *)val); min_spacing_to_set = *((u8 *)val);
if (min_spacing_to_set <= 7) { if (min_spacing_to_set <= 7) {
sec_min_space = 0;
if (min_spacing_to_set < sec_min_space)
min_spacing_to_set = sec_min_space;
mac->min_space_cfg = ((mac->min_space_cfg & 0xf8) | mac->min_space_cfg = ((mac->min_space_cfg & 0xf8) |
min_spacing_to_set); min_spacing_to_set);
......
...@@ -546,14 +546,9 @@ void rtl8821ae_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) ...@@ -546,14 +546,9 @@ void rtl8821ae_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break; break;
case HW_VAR_AMPDU_MIN_SPACE:{ case HW_VAR_AMPDU_MIN_SPACE:{
u8 min_spacing_to_set; u8 min_spacing_to_set;
u8 sec_min_space;
min_spacing_to_set = *((u8 *)val); min_spacing_to_set = *((u8 *)val);
if (min_spacing_to_set <= 7) { if (min_spacing_to_set <= 7) {
sec_min_space = 0;
if (min_spacing_to_set < sec_min_space)
min_spacing_to_set = sec_min_space;
mac->min_space_cfg = ((mac->min_space_cfg & mac->min_space_cfg = ((mac->min_space_cfg &
0xf8) | 0xf8) |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment