* [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
@ 2025-03-15 3:12 feng.wei8
2025-03-16 14:00 ` Johannes Berg
2025-03-17 8:30 ` Krzysztof Kozlowski
0 siblings, 2 replies; 6+ messages in thread
From: feng.wei8 @ 2025-03-15 3:12 UTC (permalink / raw)
To: linux-kernel; +Cc: johannes, linux-wireless
[-- Attachment #1.1.1: Type: text/plain, Size: 949 bytes --]
From: FengWei <feng.wei8@zte.com.cn>
Use min3() macro instead of nesting min() to simplify the return
statement.
Signed-off-by: FengWei <feng.wei8@zte.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
[-- Attachment #1.1.2: Type: text/html , Size: 1789 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
2025-03-15 3:12 [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3() feng.wei8
@ 2025-03-16 14:00 ` Johannes Berg
2025-03-17 4:55 ` feng.wei8
2025-03-17 8:30 ` Krzysztof Kozlowski
1 sibling, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2025-03-16 14:00 UTC (permalink / raw)
To: feng.wei8, linux-kernel; +Cc: linux-wireless
Please do not send utter garbage patches. It wastes everyone's time.
If you don't know what you're doing, just stop. There's very very little
value in such patches anyway, so don't send them. First think if it
actually does something useful, and if in doubt, don't.
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
2025-03-16 14:00 ` Johannes Berg
@ 2025-03-17 4:55 ` feng.wei8
2025-03-17 8:27 ` Krzysztof Kozlowski
0 siblings, 1 reply; 6+ messages in thread
From: feng.wei8 @ 2025-03-17 4:55 UTC (permalink / raw)
To: johannes; +Cc: linux-kernel, linux-wireless
[-- Attachment #1.1.1: Type: text/plain, Size: 1199 bytes --]
I see the following commit:
|https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ab936836ec09fa23954e8e5785d71a41e5ee8bcb
I don't think code optimization and unification is "garbage". If so, why did you choose to merge into a commit like "garbage".
I'm just bothered by this aspect when I usually look at the code, so why not be concise.
I would even like to implement `min4/max4` like `dml_min4/dml_max4`. Wouldn't that be more concise code?
As a newcomer, my perspectives may differ from those of the experts here. I apologize if this has caused any inconvenience.
Thanks
Original
From: johannes <johannes@sipsolutions.net>
To: Feng Wei10332721;linux-kernel <linux-kernel@vger.kernel.org>;
Cc: linux-wireless <linux-wireless@vger.kernel.org>;
Date: 2025/03/16 22:01
Subject: Re: [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
Please do not send utter garbage patches. It wastes everyone's time.
If you don't know what you're doing, just stop. There's very very little
value in such patches anyway, so don't send them. First think if it
actually does something useful, and if in doubt, don't.
johannes
[-- Attachment #1.1.2: Type: text/html , Size: 3433 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
2025-03-17 4:55 ` feng.wei8
@ 2025-03-17 8:27 ` Krzysztof Kozlowski
0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-17 8:27 UTC (permalink / raw)
To: feng.wei8, johannes, xie.ludan, shao.mingyin, xie.ludan,
tang.dongxing, davem, feng.wei8
Cc: linux-kernel, linux-wireless
On 17/03/2025 05:55, feng.wei8@zte.com.cn wrote:
> I see the following commit:
> |https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ab936836ec09fa23954e8e5785d71a41e5ee8bcb
I do not see Johannes merged that. Do you understand how Git and kernel
process work?
>
> I don't think code optimization and unification is "garbage". If so, why did you choose to merge into a commit like "garbage".
> I'm just bothered by this aspect when I usually look at the code, so why not be concise.
No, you just run some static tools, coccinelle or whatever else and
flood us with patches all over the tree, claiming that they improve
anything.
Nothing here was done in terms of choice of improvement but it's pure
automation.
In many places it was already pointed out that your automation is not
even correct.
> I would even like to implement `min4/max4` like `dml_min4/dml_max4`. Wouldn't that be more concise code?
>
> As a newcomer, my perspectives may differ from those of the experts here. I apologize if this has caused any inconvenience.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
2025-03-15 3:12 [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3() feng.wei8
2025-03-16 14:00 ` Johannes Berg
@ 2025-03-17 8:30 ` Krzysztof Kozlowski
2025-03-17 8:31 ` Johannes Berg
1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-17 8:30 UTC (permalink / raw)
To: feng.wei8, linux-kernel, tang.dongxing, feng.wei8, shao.mingyin,
xie.ludan, yang.guang5, yang.yang29, ye.xingchen, xu.xin16
Cc: johannes, linux-wireless
On 15/03/2025 04:12, feng.wei8@zte.com.cn wrote:
> From: FengWei <feng.wei8@zte.com.cn>
>
> Use min3() macro instead of nesting min() to simplify the return
> statement.
>
> Signed-off-by: FengWei <feng.wei8@zte.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);
This is automation-generated junk code. How does it "simplify the
statement"?
Can ZTE slow down this flood of automation or research experiment on
kernel community?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3()
2025-03-17 8:30 ` Krzysztof Kozlowski
@ 2025-03-17 8:31 ` Johannes Berg
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2025-03-17 8:31 UTC (permalink / raw)
To: Krzysztof Kozlowski, feng.wei8, linux-kernel, tang.dongxing,
shao.mingyin, xie.ludan, yang.guang5, yang.yang29, ye.xingchen,
xu.xin16
Cc: linux-wireless
On Mon, 2025-03-17 at 09:30 +0100, Krzysztof Kozlowski wrote:
>
> > +++ 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);
>
> This is automation-generated junk code. How does it "simplify the
> statement"?
It's worse. The "minus" code doesn't even exist upstream.
> Can ZTE slow down this flood of automation or research experiment on
> kernel community?
Please.
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-03-17 8:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-15 3:12 [PATCH] mac80211: minstrel_ht: Replace nested min() with single min3() feng.wei8
2025-03-16 14:00 ` Johannes Berg
2025-03-17 4:55 ` feng.wei8
2025-03-17 8:27 ` Krzysztof Kozlowski
2025-03-17 8:30 ` Krzysztof Kozlowski
2025-03-17 8:31 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox