Linux-Next discussions
 help / color / mirror / Atom feed
* [BUG] clamp() low limit 0 greater than high limit points[1] - 1
@ 2026-10-14 20:10 Paul E. McKenney
  2026-10-14 21:45 ` [PATCH] hwmon: (minisforum-um780xtx) Fix clamp() build failure with GCC 11 Sebastián Peyrott
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2026-10-14 20:10 UTC (permalink / raw)
  To: Sebastián Peyrott; +Cc: linux-hwmon, linux-kernel, Mark Brown, linux-next

Hello!

Recent -next trees have failed allmodconfig builds with the following
build error:

drivers/hwmon/minisforum-um780xtx.c: In function ‘um780xtx_sys_point_temp_store’:
  HDRTEST usr/include/linux/hash_info.h
././include/linux/compiler_types.h:702:45: error: call to ‘__compiletime_assert_727’ declared with attribute error: clamp() low limit 0 greater than high limit points[1] - 1
  702 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                             ^
././include/linux/compiler_types.h:683:25: note: in definition of macro ‘__compiletime_assert’
  683 |                         prefix ## suffix();                             \
      |                         ^~~~~~
././include/linux/compiler_types.h:702:9: note: in expansion of macro ‘_compiletime_assert’
  702 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:40:37: note: in expansion of macro ‘compiletime_assert’
   40 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
./include/linux/minmax.h:188:9: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
  188 |         BUILD_BUG_ON_MSG(statically_true(ulo > uhi),                            \
      |         ^~~~~~~~~~~~~~~~
./include/linux/minmax.h:195:9: note: in expansion of macro ‘__clamp_once’
  195 |         __clamp_once(type, val, lo, hi, __UNIQUE_ID(v_), __UNIQUE_ID(l_), __UNIQUE_ID(h_))
      |         ^~~~~~~~~~~~
./include/linux/minmax.h:231:32: note: in expansion of macro ‘__careful_clamp’
  231 | #define clamp_val(val, lo, hi) __careful_clamp(typeof(val), val, lo, hi)
      |                                ^~~~~~~~~~~~~~~
drivers/hwmon/minisforum-um780xtx.c:203:25: note: in expansion of macro ‘clamp_val’
  203 |                 value = clamp_val(value, 0, points[1] - 1);
      |                         ^~~~~~~~~

I must confess to being unsure what fix would be appropriate when
points[1] is zero or negative.

Help?

							Thanx, Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-14 23:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 20:10 [BUG] clamp() low limit 0 greater than high limit points[1] - 1 Paul E. McKenney
2026-10-14 21:45 ` [PATCH] hwmon: (minisforum-um780xtx) Fix clamp() build failure with GCC 11 Sebastián Peyrott
2026-10-14 23:03   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox