wifi: rtlwifi/rtw89: remove conditional returns with no effect
v2 cover wifi: rtlwifi/rtw89: remove conditional returns with no effect
Hello,
This series removes conditional returns where both branches return the same value, so the check has no effect. As suggested by Ping-Ke, the wifi patch of the treewide v1 series [1] is split per driver and posted separately.
Both patches are generated by the Coccinelle script, which you can find in v1.
---
Changes from v1 [1]
- Split the wifi patch per driver
- Change base to rtw/rtw-next
- Filter only rtlwifi and rtw89 changes
[1] https://lore.kernel.org/all/[email protected]/
---
Sang-Heon Jeon (2):
wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
wifi: rtw89: remove conditional return with no effect
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 7 +------ drivers/net/wireless/realtek/rtw89/mac.c | 6 +----- drivers/net/wireless/realtek/rtw89/mac_be.c | 6 +----- 3 files changed, 3 insertions(+), 16 deletions(-)
--
2.43.0
PATCH v2 1/2 wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci.
--- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +1 -6
@@ -1462,12 +1462,7 @@ static bool _rtl8821ae_init_llt_table(struct ieee80211_hw *hw, u32 boundary)return status; } - status =_rtl8821ae_llt_write (hw, last_entry_of_txpktbuf, - txpktbuf_bndy); -if (!status) -return status; - -return status; +return _rtl8821ae_llt_write (hw, last_entry_of_txpktbuf, txpktbuf_bndy); } static bool _rtl8821ae_dynamic_rqpn(struct ieee80211_hw *hw, u32 boundary,
Signature · 1 line
2.43.0
RE: [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
Quoted 7 lines · Sang-Heon Jeon
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.Signed-off-by Sang-Heon Jeon <[email protected]>
Ping-Ke Shih
maintainerRE: [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
Quoted 11 lines · Ping-Ke Shih
Quoted 7 lines · Sang-Heon Jeon
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.Signed-off-by Sang-Heon Jeon <[email protected]>Acked-by Ping-Ke Shih <[email protected]>
For the record, I'd make subject more specific:
wifi: rtlwifi: rtl8821ae: remove conditional return with no effect in _rtl8821ae_llt_write()
Ping-Ke Shih
maintainerRe: [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
In reply to Sang-Heon JeonQuoted 8 lines · Sang-Heon Jeon
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.Signed-off-by Sang-Heon Jeon <[email protected]>Acked-by Ping-Ke Shih <[email protected]>
2 patch(es) applied to rtw-next branch of rtw.git, thanks.
c13ab5bed716 wifi: rtlwifi: rtl8821ae: remove conditional return with no effect in _rtl8821ae_llt_write() bbc18041ad5f wifi: rtw89: remove conditional return with no effect in sys_init_*()
PATCH v2 2/2 wifi: rtw89: remove conditional return with no effect
In reply to Sang-Heon JeonBoth branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci.
--- drivers/net/wireless/realtek/rtw89/mac.c | 6 +----- drivers/net/wireless/realtek/rtw89/mac_be.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-)
drivers/net/wireless/realtek/rtw89/mac.c +1 -5
@@ -1710,11 +1710,7 @@ static int sys_init_ax(struct rtw89_dev *rtwdev)if (ret)return ret; - ret =chip_func_en_ax (rtwdev); -if (ret) -return ret; - -return ret; +return chip_func_en_ax (rtwdev); }const struct rtw89_mac_size_set rtw89_mac_size = {
drivers/net/wireless/realtek/rtw89/mac_be.c +1 -5
@@ -929,11 +929,7 @@ static int sys_init_be(struct rtw89_dev *rtwdev)if (ret)return ret; - ret =chip_func_en_be (rtwdev); -if (ret) -return ret; - -return ret; +return chip_func_en_be (rtwdev); }static int mac_func_en_be (struct rtw89_dev *rtwdev)
Signature · 1 line
2.43.0
RE: [PATCH rtw-next v2 2/2] wifi: rtw89: remove conditional return with no effect
Quoted 7 lines · Sang-Heon Jeon
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.Signed-off-by Sang-Heon Jeon <[email protected]>
I'd update the subject to be more specific during it gets merged.
"wifi: rtw89: remove conditional return with no effect in sys_init_*()"