Thread (79 messages) 79 messages, 9 authors, 2024-12-09

Re: [PATCH 05/10] minmax: simplify __clamp_once() by using is_const_false()

From: Vincent Mailhol <hidden>
Date: 2024-12-06 02:25:13
Also in: dri-devel, intel-gfx, linux-hardening, lkml, llvm

On Thu. 5 Dec. 2024 at 03:54, David Laight [off-list ref] wrote:
From: Vincent Mailhol
quoted
Sent: 02 December 2024 17:33

In __clamp_once(),

  __builtin_choose_expr(__is_constexpr((lo) > (hi)), (lo) <= (hi), true)

is equivalent to:

  !is_const_false((lo) <= (hi))

Apply is_const_false() to simplify __clamp_once().
There is already a patch 'for next' that changes it use BUILD_BUG_ON_MSG()
and statically_true().
Found it!

  https://lore.kernel.org/all/34d53778977747f19cce2abb287bb3e6@AcuMS.aculab.com/ (local)

I think the easiest would be for me to cherry pick this patch. So that
regardless which series is merged first, no conflict will occur, the
patch will just be skipped the second time it is encountered.

Does this work for you?


Yours sincerely,
Vincent Mailhol
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help