public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: minstrel_ht: Simplify minimum determination in minstrel_ht_refill_sample_rates()
@ 2025-02-28 10:23 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-02-28 10:23 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg; +Cc: LKML, kernel-janitors, Qasim Ijaz

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 28 Feb 2025 11:13:58 +0100

Replace nested min() calls by single min3() call in this
function implementation.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 net/mac80211/rc80211_minstrel_ht.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 706cbc99f718..31a3b6e4c58d 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -1010,7 +1010,7 @@ minstrel_ht_refill_sample_rates(struct minstrel_ht_sta *mi)
 	u32 prob_dur = minstrel_get_duration(mi->max_prob_rate);
 	u32 tp_dur = minstrel_get_duration(mi->max_tp_rate[0]);
 	u32 tp2_dur = minstrel_get_duration(mi->max_tp_rate[1]);
-	u32 fast_rate_dur = min(min(tp_dur, tp2_dur), prob_dur);
+	u32 fast_rate_dur = min3(tp_dur, tp2_dur, prob_dur);
 	u32 slow_rate_dur = max(max(tp_dur, tp2_dur), prob_dur);
 	u16 *rates;
 	int i, j;
--
2.48.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-28 10:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 10:23 [PATCH] mac80211: minstrel_ht: Simplify minimum determination in minstrel_ht_refill_sample_rates() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox