lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250315111254625RMIKeUh51j1Xk9CWuu2LT@zte.com.cn>
Date: Sat, 15 Mar 2025 11:12:54 +0800 (CST)
From: <feng.wei8@....com.cn>
To: <linux-kernel@...r.kernel.org>
Cc: <johannes@...solutions.net>, <linux-wireless@...r.kernel.org>
Subject: [PATCH] mac80211: minstrel_ht: Replace nested min() with single

 min3()

From: FengWei <feng.wei8@....com.cn>

Use min3() macro instead of nesting min() to simplify the return
statement.

Signed-off-by: FengWei <feng.wei8@....com.cn>
---
 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 08f3f530f984..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(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.25.1
<div class="zcontentRow"><p>From: FengWei &lt;feng.wei8@....com.cn&gt;<br></p><p><br></p><p>Use min3() macro instead of nesting min() to simplify the return</p><p>statement.</p><p><br></p><p>Signed-off-by: FengWei &lt;feng.wei8@....com.cn&gt;</p><p>---</p><p>&nbsp;net/mac80211/rc80211_minstrel_ht.c | 2 +-</p><p>&nbsp;1 file changed, 1 insertion(+), 1 deletion(-)</p><p><br></p><p>diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c</p><p>index 08f3f530f984..31a3b6e4c58d 100644</p><p>--- a/net/mac80211/rc80211_minstrel_ht.c</p><p>+++ b/net/mac80211/rc80211_minstrel_ht.c</p><p>@@ -1010,7 +1010,7 @@ minstrel_ht_refill_sample_rates(struct minstrel_ht_sta *mi)</p><p>&nbsp;<span style="white-space:pre">	</span>u32 prob_dur = minstrel_get_duration(mi-&gt;max_prob_rate);</p><p>&nbsp;<span style="white-space:pre">	</span>u32 tp_dur = minstrel_get_duration(mi-&gt;max_tp_rate[0]);</p><p>&nbsp;<span style="white-space:pre">	</span>u32 tp2_dur = minstrel_get_duration(mi-&gt;max_tp_rate[1]);</p><p>-<span style="white-space:pre">	</span>u32 fast_rate_dur = min(tp_dur, tp2_dur, prob_dur);</p><p>+<span style="white-space:pre">	</span>u32 fast_rate_dur = min3(tp_dur, tp2_dur, prob_dur);</p><p>&nbsp;<span style="white-space:pre">	</span>u32 slow_rate_dur = max(max(tp_dur, tp2_dur), prob_dur);</p><p>&nbsp;<span style="white-space:pre">	</span>u16 *rates;</p><p>&nbsp;<span style="white-space:pre">	</span>int i, j;</p><p>--&nbsp;</p><p>2.25.1</p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p></div>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ