Re: [PATCH v2] minmax: clamp more efficiently by avoiding extra comparison

Andy Shevchenko
2022-09-23T16:53:35Z

On Fri, Sep 23, 2022 at 09:41:19AM -0700, Kees Cook wrote:
> On Fri, Sep 23, 2022 at 05:40:01PM +0200, Jason A. Donenfeld wrote:

...

> > + __clamp(val, lo, hi), \
> > + __clamp_once(val, lo, hi, __UNIQUE_ID(__val), __UNIQUE_ID(__lo), __UNIQUE_ID(__hi))); })
>
> *complaint about line being >100 characters, but I don't really care* If
> anyone is really bothered, this looks fine, too:
>
> __clamp_once(val, lo, hi, \
> __UNIQUE_ID(__val), __UNIQUE_ID(__lo), __UNIQUE_ID(__hi))); })

Actually }) should occupy a separate line and it would be nice to have it for ({.

--
With Best Regards,
Andy Shevchenko