[RFC PATCH v2 01/33] eal: add more min/max helpers

Morten Brørup mb at smartsharesystems.com
Mon Nov 10 09:53:22 CET 2025


> From: fengchengwen [mailto:fengchengwen at huawei.com]
> 
> Acked-by: Chengwen Feng <fengchengwen at huawei.com>
> 
> On 11/7/2025 11:49 PM, Bruce Richardson wrote:
> > From: Stephen Hemminger <stephen at networkplumber.org>
> >
> > Add RTE_MIN3() to handle case of RTE_MIN(RTE_MIN(...)), and similarly
> > add RTE_MAX3().

Do we need RTE_MIN3_T()/RTE_MAX3_T() macros too?

> > Change name of local temporary variables in RTE_MAX()
> > to allow for combinations of RTE_MIN(RTE_MAX(...)) without causing
> > shadow declaration warnings.

Consider making the local temporary variables in RTE_MIN() more unique too, in case the macro is combined with some other macro also using _a and _b.

<feature creep>
Maybe an RTE_MINMAX(min,max,val) would be useful?
Same about RTE_MINMAX_T(min,max,val,type)?
</feature creep>

> >
> > Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>

With or without suggested additions,
Acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list