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

Morten Brørup
2025-11-10T08:53:29Z

> From: fengchengwen [mailto:fengchengwen@huawei.com]
>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> On 11/7/2025 11:49 PM, Bruce Richardson wrote:
> > From: Stephen Hemminger <stephen@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@networkplumber.org>
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

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