mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	 Leonardo Martins Martins <dev.lmmrtns@gmail.com>
Subject: [PATCH 1/4] staging: rtl8723bs: remove invariant parameters from issue_probereq_ex()
Date: Thu, 03 Sep 2026 02:18:07 -0300	[thread overview]
Message-ID: <20260903-issue_probereq-v1-1-82f153d157a1@gmail.com> (raw)
In-Reply-To: <20260903-issue_probereq-v1-0-82f153d157a1@gmail.com>

The parameters ch, append_wps, try_cnt and wait_ms are 0 in all usages
of issue_probereq_ex(), remove them. With try_cnt always being 0, the
condition (i < try_cnt) is always false, so the do-while statement is
redundant and the msleep() call is unreachable, (wait_ms > 0) is also
always false, and without the do-while and msleep() the conditional
break is also redundant, remove all this dead code.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c    | 33 +++++++-----------------
 drivers/staging/rtl8723bs/include/rtw_mlme_ext.h |  2 +-
 2 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 0c00be09fbf346aeff82be31aae801ae9265a9b0..4bdd2ae24d274cdc4b2c6496f385856c6039c55c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -2499,25 +2499,11 @@ inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps
 	_issue_probereq(padapter, pssid, da, 0, 1, false);
 }
 
-int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, u8 ch, bool append_wps,
-	int try_cnt, int wait_ms)
+int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da)
 {
 	int ret;
-	int i = 0;
-
-	do {
-		ret = _issue_probereq(padapter, pssid, da, ch, append_wps,
-				      wait_ms > 0);
 
-		i++;
-
-		if (padapter->driver_stopped || padapter->bSurpriseRemoved)
-			break;
-
-		if (i < try_cnt && wait_ms > 0 && ret == _FAIL)
-			msleep(wait_ms);
-
-	} while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0)));
+	ret = _issue_probereq(padapter, pssid, da, 0, 0, false);
 
 	if (ret != _FAIL) {
 		ret = _SUCCESS;
@@ -3768,7 +3754,9 @@ void site_survey(struct adapter *padapter)
 					if (padapter->registrypriv.wifi_spec)
 						issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
 					else
-						issue_probereq_ex(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL, 0, 0, 0, 0);
+						issue_probereq_ex(padapter,
+								  &pmlmeext->sitesurvey_res.ssid[i],
+								  NULL);
 
 					issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
 				}
@@ -3778,7 +3766,7 @@ void site_survey(struct adapter *padapter)
 					if (padapter->registrypriv.wifi_spec)
 						issue_probereq(padapter, NULL, NULL);
 					else
-						issue_probereq_ex(padapter, NULL, NULL, 0, 0, 0, 0);
+						issue_probereq_ex(padapter, NULL, NULL);
 					issue_probereq(padapter, NULL, NULL);
 				}
 			}
@@ -4899,16 +4887,13 @@ void linked_status_chk(struct adapter *padapter)
 					if (pmlmeext->retry == 0) {
 						issue_probereq_ex(padapter,
 								  &pmlmeinfo->network.ssid,
-								  pmlmeinfo->network.mac_address,
-								  0, 0, 0, 0);
+								  pmlmeinfo->network.mac_address);
 						issue_probereq_ex(padapter,
 								  &pmlmeinfo->network.ssid,
-								  pmlmeinfo->network.mac_address,
-								  0, 0, 0, 0);
+								  pmlmeinfo->network.mac_address);
 						issue_probereq_ex(padapter,
 								  &pmlmeinfo->network.ssid,
-								  pmlmeinfo->network.mac_address,
-								  0, 0, 0, 0);
+								  pmlmeinfo->network.mac_address);
 					}
 				}
 
diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index 70fb161afd09efc197e3f59c72972d9a611cbf01..acea9cef7756e158c7ab9e357a06a7aab300943f 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -542,7 +542,7 @@ void issue_assocreq(struct adapter *padapter);
 void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type);
 void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status);
 void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da);
-s32 issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, u8 ch, bool append_wps, int try_cnt, int wait_ms);
+s32 issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da);
 int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms);
 s32 issue_nulldata_in_interrupt(struct adapter *padapter, u8 *da);
 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms);

-- 
2.47.3


  reply	other threads:[~2026-09-03  5:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  5:18 [PATCH 0/4] staging: rtl8723bs: refactor issue_probereq() into a single function Leonardo Martins Martins
2026-09-03  5:18 ` Leonardo Martins Martins [this message]
2026-09-03  5:18 ` [PATCH 2/4] staging: rtl8723bs: change issue_probereq return types to void Leonardo Martins Martins
2026-09-03  5:18 ` [PATCH 3/4] staging: rtl8723bs: remove invariant parameters from _issue_probereq() Leonardo Martins Martins
2026-09-03  5:18 ` [PATCH 4/4] staging: rtl8723bs: coalesce issue_probereq functions into a single one Leonardo Martins Martins

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=20260903-issue_probereq-v1-1-82f153d157a1@gmail.com \
    --to=dev.lmmrtns@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®