RE: [PATCH 5/9] vdso: Split linux/minmax.h

From: David Laight
Date: Sun Sep 08 2024 - 15:59:33 EST


From: Vincenzo Frascino
> Sent: 06 September 2024 12:41
>
> On 04/09/2024 18:23, Arnd Bergmann wrote:
> > On Wed, Sep 4, 2024, at 17:17, Christophe Leroy wrote:
> >> Le 03/09/2024 à 17:14, Vincenzo Frascino a écrit :
> >>> The VDSO implementation includes headers from outside of the
> >>> vdso/ namespace.
> >>>
> >>> Split linux/minmax.h to make sure that the generic library
> >>> uses only the allowed namespace.
> >>
> >> It is probably easier to just don't use min_t() in VDSO. Can be open
> >> coded without impeeding readability.
> >
> > Right, or possibly the even simpler MIN()/MAX() if the arguments
> > have no side-effects.
> >
>
> Agreed, generally I do not like open-coding since it tends to introduce
> duplication, but these cases are simple especially if we can use MIN()/MAX().

Aren't MIN()/MAX() likely to get defined in minmax.h for cases where the
arguments are constants - and maybe have checks that they are constants.
So you don't want to define them in the VDSO header either.

Open coding simple cases is actually easier to read :-)

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)