From patchwork Sat Mar 15 03:12:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: feng.wei8@zte.com.cn X-Patchwork-Id: 873992 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC176178CF8; Sat, 15 Mar 2025 03:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.216.63.40 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742008389; cv=none; b=bWzfPMIgVp/Xw6dHxZ7RZcctFcrb91+ZEH8LuVFBXJzhMr622lBAihjAGX9CoklZzTv5DQuREPn6krG/kaj/u04MJOYBG/1poChusr6Ednk4rq2drz0yet4cj2C7+GUXUxxVnmoUTgjvdIIBwQVlm67tS6obHW+i4SX6D28LvAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742008389; c=relaxed/simple; bh=clmIaqAeSifdCcY5HnUSdpYLwnaZiIp7MkwL/1ZH18Q=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=pY7kVTKrThJdmmTptxh4eZsktT+7Vefd14OeWuEGWh0b1MKhU+mCg9RQp2Qntxc03xpBgzfp6eg/1TKNREfA1iTFP48q6nDy+BrMqJeVukB1tOlEGZ3ffLTT7WwSYosARskO9IL4UJtoTFj6LL2yWK2SVoR7+BCIqdidqRSXsUo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=63.216.63.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4ZF5s94y7Qz8QrkZ; Sat, 15 Mar 2025 11:13:01 +0800 (CST) Received: from xaxapp04.zte.com.cn ([10.99.98.157]) by mse-fl1.zte.com.cn with SMTP id 52F3CrZe043981; Sat, 15 Mar 2025 11:12:53 +0800 (+08) (envelope-from feng.wei8@zte.com.cn) Received: from mapi (xaxapp05[null]) by mapi (Zmail) with MAPI id mid32; Sat, 15 Mar 2025 11:12:54 +0800 (CST) Date: Sat, 15 Mar 2025 11:12:54 +0800 (CST) X-Zmail-TransId: 2afc67d4f036ffffffff8b0-b175a X-Mailer: Zmail v1.0 Message-ID: <20250315111254625RMIKeUh51j1Xk9CWuu2LT@zte.com.cn> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: Cc: , Subject: =?utf-8?q?=5BPATCH=5D_mac80211=3A_minstrel=5Fht=3A_Replace_nested_m?= =?utf-8?q?in=28=29_with_single?= =?utf-8?q?_?= =?utf-8?q?_min3=28=29?= X-MAIL: mse-fl1.zte.com.cn 52F3CrZe043981 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 67D4F03D.003/4ZF5s94y7Qz8QrkZ From: FengWei Use min3() macro instead of nesting min() to simplify the return statement. Signed-off-by: FengWei --- 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;