From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Julia.Lawall@inria.fr,
Miri Korenblit <miriam.rachel.korenblit@intel.com>,
Ping-Ke Shih <pkshih@realtek.com>
Cc: cocci@inria.fr, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org
Subject: [PATCH 10/36] wifi: remove conditional return with no effect
Date: Fri, 24 Jul 2026 03:45:12 +0900 [thread overview]
Message-ID: <20260723184538.3888637-11-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260723184538.3888637-1-ekffu200098@gmail.com>
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/ath/ath6kl/init.c | 6 +-----
drivers/net/wireless/intel/iwlwifi/mvm/link.c | 6 +-----
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 +-----
5 files changed, 5 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 782209dcb782..61fa10d88714 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1566,11 +1566,7 @@ static int ath6kl_init_upload(struct ath6kl *ar)
address = MBOX_BASE_ADDRESS + LOCAL_SCRATCH_ADDRESS;
param = options | 0x20;
- status = ath6kl_bmi_reg_write(ar, address, param);
- if (status)
- return status;
-
- return status;
+ return ath6kl_bmi_reg_write(ar, address, param);
}
int ath6kl_init_hw_params(struct ath6kl *ar)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
index b5d252ece2d9..76a548f9aea2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
@@ -278,11 +278,7 @@ int iwl_mvm_disable_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (ret)
return ret;
- ret = iwl_mvm_remove_link(mvm, vif, link_conf);
- if (ret)
- return ret;
-
- return ret;
+ return iwl_mvm_remove_link(mvm, vif, link_conf);
}
void iwl_mvm_init_link(struct iwl_mvm_vif_link_info *link)
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,
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 8c395517bd2f..967b42f2b6fb 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -1706,11 +1706,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 f24c119b99f1..b7ba8de9cc78 100644
--- a/drivers/net/wireless/realtek/rtw89/mac_be.c
+++ b/drivers/net/wireless/realtek/rtw89/mac_be.c
@@ -924,11 +924,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
next prev parent reply other threads:[~2026-07-23 18:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 18:45 [PATCH 00/36] treewide: remove conditional returns with no effect Sang-Heon Jeon
2026-07-23 18:45 ` Sang-Heon Jeon [this message]
2026-07-24 0:37 ` [PATCH 10/36] wifi: remove conditional return " Ping-Ke Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260723184538.3888637-11-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=Julia.Lawall@inria.fr \
--cc=cocci@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=pkshih@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox