Re: [PATCH v2 wireless 1/3] wifi: carl9170: replace open-coded IE search with cfg80211_find_ie()

From: Christian Lamparter

Date: Tue Oct 27 2026 - 14:44:07 EST


On 10/26/26 11:32 PM, Tristan Madani wrote:
carl9170_find_ie() open-codes the IE search that cfg80211_find_ie()
already provides. Replace the hand-rolled function with
cfg80211_find_ie() at the single call site.

Fixes: a84fab3cbfdc4 ("carl9170: 802.11 rx/tx processing and usb backend")
Signed-off-by: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>

Sure!

Acked-by: Christian Lamparter <chunkeey@xxxxxxxxx>

---
drivers/net/wireless/ath/carl9170/rx.c | 27 ++++++--------------------
1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index fbe46a5e4e415..9db6ac9d6d3c0 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
> [...]> @@ -541,7 +523,10 @@ static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len)
ar->ps.last_beacon = jiffies;
- tim = carl9170_find_ie(data, len - FCS_LEN, WLAN_EID_TIM);
+ tim = cfg80211_find_ie(WLAN_EID_TIM, mgmt->u.beacon.variable,
+ (len - FCS_LEN) -
+ offsetof(struct ieee80211_mgmt,
+ u.beacon.variable));

nit:
If there ever will be a v3. You could consider that the 80 characters per line
is not a strict rule.

This is straight out of "Documentation/process/maintainer-tip.rst:
"The 80 character rule is not a strict rule, so please use common sense when
breaking lines. Especially format strings should never be broken up."

my 2¢:
tim = cfg80211_find_ie(WLAN_EID_TIM, mgmt->u.beacon.variable,
len - FCS_LEN - offsetof(struct ieee80211_mgmt, u.beacon.variable));

Cheers,
Christian