* [PATCH rtw-next v2 0/2] wifi: rtlwifi/rtw89: remove conditional returns with no effect
@ 2026-07-26 13:40 Sang-Heon Jeon
2026-07-26 13:40 ` [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return " Sang-Heon Jeon
2026-07-26 13:40 ` [PATCH rtw-next v2 2/2] wifi: rtw89: " Sang-Heon Jeon
0 siblings, 2 replies; 6+ messages in thread
From: Sang-Heon Jeon @ 2026-07-26 13:40 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-kernel, linux-wireless
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/20260723184538.3888637-1-ekffu200098@gmail.com/
---
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
2026-07-26 13:40 [PATCH rtw-next v2 0/2] wifi: rtlwifi/rtw89: remove conditional returns with no effect Sang-Heon Jeon
@ 2026-07-26 13:40 ` Sang-Heon Jeon
2026-07-27 2:04 ` Ping-Ke Shih
2026-07-26 13:40 ` [PATCH rtw-next v2 2/2] wifi: rtw89: " Sang-Heon Jeon
1 sibling, 1 reply; 6+ messages in thread
From: Sang-Heon Jeon @ 2026-07-26 13:40 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-kernel, linux-wireless
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 <ekffu200098@gmail.com>
---
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index 9b119a51bc30..1ba53e671207 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH rtw-next v2 2/2] wifi: rtw89: remove conditional return with no effect
2026-07-26 13:40 [PATCH rtw-next v2 0/2] wifi: rtlwifi/rtw89: remove conditional returns with no effect Sang-Heon Jeon
2026-07-26 13:40 ` [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return " Sang-Heon Jeon
@ 2026-07-26 13:40 ` Sang-Heon Jeon
2026-07-27 2:06 ` Ping-Ke Shih
1 sibling, 1 reply; 6+ messages in thread
From: Sang-Heon Jeon @ 2026-07-26 13:40 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-kernel, linux-wireless
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 <ekffu200098@gmail.com>
---
drivers/net/wireless/realtek/rtw89/mac.c | 6 +-----
drivers/net/wireless/realtek/rtw89/mac_be.c | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index db9fca828829..2cbff2be9bbb 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -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 = {
diff --git a/drivers/net/wireless/realtek/rtw89/mac_be.c b/drivers/net/wireless/realtek/rtw89/mac_be.c
index 8de0fe5a3b1d..dfa0973e367c 100644
--- a/drivers/net/wireless/realtek/rtw89/mac_be.c
+++ b/drivers/net/wireless/realtek/rtw89/mac_be.c
@@ -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)
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
2026-07-26 13:40 ` [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return " Sang-Heon Jeon
@ 2026-07-27 2:04 ` Ping-Ke Shih
2026-07-27 2:09 ` Ping-Ke Shih
0 siblings, 1 reply; 6+ messages in thread
From: Ping-Ke Shih @ 2026-07-27 2:04 UTC (permalink / raw)
To: Sang-Heon Jeon
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
> 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 <ekffu200098@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH rtw-next v2 2/2] wifi: rtw89: remove conditional return with no effect
2026-07-26 13:40 ` [PATCH rtw-next v2 2/2] wifi: rtw89: " Sang-Heon Jeon
@ 2026-07-27 2:06 ` Ping-Ke Shih
0 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2026-07-27 2:06 UTC (permalink / raw)
To: Sang-Heon Jeon
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
> 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 <ekffu200098@gmail.com>
I'd update the subject to be more specific during it gets merged.
"wifi: rtw89: remove conditional return with no effect in sys_init_*()"
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return with no effect
2026-07-27 2:04 ` Ping-Ke Shih
@ 2026-07-27 2:09 ` Ping-Ke Shih
0 siblings, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2026-07-27 2:09 UTC (permalink / raw)
To: Ping-Ke Shih, Sang-Heon Jeon
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Ping-Ke Shih <pkshih@realtek.com> wrote:
> Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
> > 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 <ekffu200098@gmail.com>
>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
>
For the record, I'd make subject more specific:
wifi: rtlwifi: rtl8821ae: remove conditional return with no effect in _rtl8821ae_llt_write()
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-27 2:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-26 13:40 [PATCH rtw-next v2 0/2] wifi: rtlwifi/rtw89: remove conditional returns with no effect Sang-Heon Jeon
2026-07-26 13:40 ` [PATCH rtw-next v2 1/2] wifi: rtlwifi: rtl8821ae: remove conditional return " Sang-Heon Jeon
2026-07-27 2:04 ` Ping-Ke Shih
2026-07-27 2:09 ` Ping-Ke Shih
2026-07-26 13:40 ` [PATCH rtw-next v2 2/2] wifi: rtw89: " Sang-Heon Jeon
2026-07-27 2:06 ` Ping-Ke Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox