[PATCH v4 1/6] eal: introduce RTE_MIN_T() and RTE_MAX_T() macros

Stephen Hemminger stephen at networkplumber.org
Fri Jan 19 23:39:36 CET 2024


On Fri, 19 Jan 2024 12:58:47 -0800
Tyler Retzlaff <roretzla at linux.microsoft.com> wrote:

> On Wed, Jan 17, 2024 at 10:19:55AM -0800, Stephen Hemminger wrote:
> > These macros work like RTE_MIN and RTE_MAX but take an explicit
> > type. Necessary when being used in static assertions since
> > RTE_MIN and RTE_MAX use temporary variables which confuses
> > compilers constant expression checks. These macros could also
> > be useful in other scenarios when bounded range is useful.
> > 
> > Naming is chosen to be similar to Linux kernel conventions.  
> 
> parameter ordering seems weird, also Linux kernel copied? just curious
> more than anything. if not i would put 't' as the first parameter.
> 
> Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>

Hmm, kernel version takes type first will use that.


More information about the dev mailing list