All of lore.kernel.org
 help / color / mirror / Atom feed
* [lee-backlight:for-backlight-next 1/4] include/linux/math.h:162:17: error: first argument to '__builtin_choose_expr' not a constant
@ 2025-11-13 19:04 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-13 19:04 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: oe-kbuild-all, Lee Jones, Daniel Thompson (RISCstar),
	Simona Vetter

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
head:   67d8eed26eadb1edd4873d24889be26aa9b73fe5
commit: 243ce64b2b371cdf2cbc39c9422cb3047cab6de7 [1/4] backlight: Do not include <linux/fb.h> in header file
config: powerpc-ppc6xx_defconfig (https://download.01.org/0day-ci/archive/20251114/202511140227.xzHsIPcb-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251114/202511140227.xzHsIPcb-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511140227.xzHsIPcb-lkp@intel.com/

All errors (new ones prefixed by >>):

         |         ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:84:22: note: in expansion of macro '___PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^~~~~~~~
   include/linux/compiler.h:166:29: note: in expansion of macro '__PASTE'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^~~~~~~
   include/linux/compiler_types.h:84:22: note: in expansion of macro '___PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^~~~~~~~
   include/linux/compiler.h:166:37: note: in expansion of macro '__PASTE'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                                     ^~~~~~~
   include/linux/minmax.h:98:38: note: in expansion of macro '__UNIQUE_ID'
      98 |         __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |                                      ^~~~~~~~~~~
   include/linux/minmax.h:112:25: note: in expansion of macro '__careful_cmp'
     112 | #define max(x, y)       __careful_cmp(max, x, y)
         |                         ^~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:45:23: note: in expansion of macro 'max'
      45 |                 max = max((int)bl_curve[i], max);
         |                       ^~~
   include/linux/minmax.h:71:17: error: first argument to '__builtin_choose_expr' not a constant
      71 |         (typeof(__builtin_choose_expr(sizeof(ux) > 4, 1LL, 1L)))(ux) >= 0)
         |                 ^~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:577:23: note: in definition of macro '__compiletime_assert'
     577 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:597:9: note: in expansion of macro '_compiletime_assert'
     597 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      93 |         BUILD_BUG_ON_MSG(!__types_ok(ux, uy),           \
         |         ^~~~~~~~~~~~~~~~
   include/linux/minmax.h:70:25: note: in expansion of macro 'statically_true'
      70 | #define __is_nonneg(ux) statically_true( \
         |                         ^~~~~~~~~~~~~~~
   include/linux/minmax.h:50:14: note: in expansion of macro '__is_nonneg'
      50 |         (2 + __is_nonneg(ux)) : (1 + 2 * (sizeof(ux) < 4)))
         |              ^~~~~~~~~~~
   include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
      75 |         (__sign_use(ux) & __sign_use(uy))
         |          ^~~~~~~~~~
   include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
      93 |         BUILD_BUG_ON_MSG(!__types_ok(ux, uy),           \
         |                           ^~~~~~~~~~
   include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
      98 |         __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:112:25: note: in expansion of macro '__careful_cmp'
     112 | #define max(x, y)       __careful_cmp(max, x, y)
         |                         ^~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:45:23: note: in expansion of macro 'max'
      45 |                 max = max((int)bl_curve[i], max);
         |                       ^~~
   include/linux/minmax.h:71:17: error: first argument to '__builtin_choose_expr' not a constant
      71 |         (typeof(__builtin_choose_expr(sizeof(ux) > 4, 1LL, 1L)))(ux) >= 0)
         |                 ^~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:577:23: note: in definition of macro '__compiletime_assert'
     577 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:597:9: note: in expansion of macro '_compiletime_assert'
     597 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      93 |         BUILD_BUG_ON_MSG(!__types_ok(ux, uy),           \
         |         ^~~~~~~~~~~~~~~~
   include/linux/minmax.h:70:25: note: in expansion of macro 'statically_true'
      70 | #define __is_nonneg(ux) statically_true( \
         |                         ^~~~~~~~~~~~~~~
   include/linux/minmax.h:50:14: note: in expansion of macro '__is_nonneg'
      50 |         (2 + __is_nonneg(ux)) : (1 + 2 * (sizeof(ux) < 4)))
         |              ^~~~~~~~~~~
   include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
      75 |         (__sign_use(ux) & __sign_use(uy))
         |          ^~~~~~~~~~
   include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
      93 |         BUILD_BUG_ON_MSG(!__types_ok(ux, uy),           \
         |                           ^~~~~~~~~~
   include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
      98 |         __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:112:25: note: in expansion of macro '__careful_cmp'
     112 | #define max(x, y)       __careful_cmp(max, x, y)
         |                         ^~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:45:23: note: in expansion of macro 'max'
      45 |                 max = max((int)bl_curve[i], max);
         |                       ^~~
   In file included from include/linux/kernel.h:27,
                    from arch/powerpc/include/asm/page.h:11,
                    from arch/powerpc/include/asm/thread_info.h:13,
                    from include/linux/thread_info.h:60,
                    from arch/powerpc/include/asm/ptrace.h:342,
                    from drivers/macintosh/via-pmu-backlight.c:11:
>> include/linux/math.h:162:17: error: first argument to '__builtin_choose_expr' not a constant
     162 |                 __builtin_choose_expr(                                  \
         |                 ^~~~~~~~~~~~~~~~~~~~~
   include/linux/math.h:170:61: note: in definition of macro '__abs_choose_expr'
     170 |         ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                             ^~~~~
   include/linux/math.h:158:17: note: in expansion of macro '__abs_choose_expr'
     158 |                 __abs_choose_expr(x, long,                              \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:159:17: note: in expansion of macro '__abs_choose_expr'
     159 |                 __abs_choose_expr(x, int,                               \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:160:17: note: in expansion of macro '__abs_choose_expr'
     160 |                 __abs_choose_expr(x, short,                             \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:161:17: note: in expansion of macro '__abs_choose_expr'
     161 |                 __abs_choose_expr(x, char,                              \
         |                 ^~~~~~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:49:28: note: in expansion of macro 'abs'
      49 |                 int diff = abs(bl_curve[i] - value);
         |                            ^~~
   include/linux/math.h:167:43: error: first argument to '__builtin_choose_expr' not a constant
     167 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr(        \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/math.h:170:61: note: in definition of macro '__abs_choose_expr'
     170 |         ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                             ^~~~~
   include/linux/math.h:158:17: note: in expansion of macro '__abs_choose_expr'
     158 |                 __abs_choose_expr(x, long,                              \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:159:17: note: in expansion of macro '__abs_choose_expr'
     159 |                 __abs_choose_expr(x, int,                               \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:160:17: note: in expansion of macro '__abs_choose_expr'
     160 |                 __abs_choose_expr(x, short,                             \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:161:17: note: in expansion of macro '__abs_choose_expr'
     161 |                 __abs_choose_expr(x, char,                              \
         |                 ^~~~~~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:49:28: note: in expansion of macro 'abs'
      49 |                 int diff = abs(bl_curve[i] - value);
         |                            ^~~
   include/linux/math.h:167:43: error: first argument to '__builtin_choose_expr' not a constant
     167 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr(        \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/math.h:170:61: note: in definition of macro '__abs_choose_expr'
     170 |         ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                             ^~~~~
   include/linux/math.h:158:17: note: in expansion of macro '__abs_choose_expr'
     158 |                 __abs_choose_expr(x, long,                              \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:159:17: note: in expansion of macro '__abs_choose_expr'
     159 |                 __abs_choose_expr(x, int,                               \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:160:17: note: in expansion of macro '__abs_choose_expr'
     160 |                 __abs_choose_expr(x, short,                             \
         |                 ^~~~~~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:49:28: note: in expansion of macro 'abs'
      49 |                 int diff = abs(bl_curve[i] - value);
         |                            ^~~
   include/linux/math.h:167:43: error: first argument to '__builtin_choose_expr' not a constant
     167 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr(        \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/math.h:170:61: note: in definition of macro '__abs_choose_expr'
     170 |         ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                             ^~~~~
   include/linux/math.h:158:17: note: in expansion of macro '__abs_choose_expr'
     158 |                 __abs_choose_expr(x, long,                              \
         |                 ^~~~~~~~~~~~~~~~~
   include/linux/math.h:159:17: note: in expansion of macro '__abs_choose_expr'
     159 |                 __abs_choose_expr(x, int,                               \
         |                 ^~~~~~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:49:28: note: in expansion of macro 'abs'
      49 |                 int diff = abs(bl_curve[i] - value);
         |                            ^~~
   include/linux/math.h:167:43: error: first argument to '__builtin_choose_expr' not a constant
     167 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr(        \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/math.h:170:61: note: in definition of macro '__abs_choose_expr'
     170 |         ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other)
         |                                                             ^~~~~
   include/linux/math.h:158:17: note: in expansion of macro '__abs_choose_expr'
     158 |                 __abs_choose_expr(x, long,                              \
         |                 ^~~~~~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:49:28: note: in expansion of macro 'abs'
      49 |                 int diff = abs(bl_curve[i] - value);
         |                            ^~~
   include/linux/math.h:167:43: error: first argument to '__builtin_choose_expr' not a constant
     167 | #define __abs_choose_expr(x, type, other) __builtin_choose_expr(        \
         |                                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/math.h:157:17: note: in expansion of macro '__abs_choose_expr'
     157 | #define abs(x)  __abs_choose_expr(x, long long,                         \
         |                 ^~~~~~~~~~~~~~~~~
   drivers/macintosh/via-pmu-backlight.c:49:28: note: in expansion of macro 'abs'
      49 |                 int diff = abs(bl_curve[i] - value);
         |                            ^~~
   drivers/macintosh/via-pmu-backlight.c: In function 'pmu_backlight_get_level_brightness':
   drivers/macintosh/via-pmu-backlight.c:63:38: error: 'FB_BACKLIGHT_MAX' undeclared (first use in this function); did you mean 'BACKLIGHT_RAW'?
      63 |         pmulevel = bl_curve[level] * FB_BACKLIGHT_MAX / MAX_PMU_LEVEL;
         |                                      ^~~~~~~~~~~~~~~~
         |                                      BACKLIGHT_RAW


vim +/__builtin_choose_expr +162 include/linux/math.h

aa6159ab99a9ab Andy Shevchenko 2020-12-15  148  
aa6159ab99a9ab Andy Shevchenko 2020-12-15  149  /**
aa6159ab99a9ab Andy Shevchenko 2020-12-15  150   * abs - return absolute value of an argument
aa6159ab99a9ab Andy Shevchenko 2020-12-15  151   * @x: the value.  If it is unsigned type, it is converted to signed type first.
aa6159ab99a9ab Andy Shevchenko 2020-12-15  152   *     char is treated as if it was signed (regardless of whether it really is)
aa6159ab99a9ab Andy Shevchenko 2020-12-15  153   *     but the macro's return type is preserved as char.
aa6159ab99a9ab Andy Shevchenko 2020-12-15  154   *
aa6159ab99a9ab Andy Shevchenko 2020-12-15  155   * Return: an absolute value of x.
aa6159ab99a9ab Andy Shevchenko 2020-12-15  156   */
aa6159ab99a9ab Andy Shevchenko 2020-12-15  157  #define abs(x)	__abs_choose_expr(x, long long,				\
aa6159ab99a9ab Andy Shevchenko 2020-12-15  158  		__abs_choose_expr(x, long,				\
aa6159ab99a9ab Andy Shevchenko 2020-12-15  159  		__abs_choose_expr(x, int,				\
aa6159ab99a9ab Andy Shevchenko 2020-12-15  160  		__abs_choose_expr(x, short,				\
aa6159ab99a9ab Andy Shevchenko 2020-12-15  161  		__abs_choose_expr(x, char,				\
aa6159ab99a9ab Andy Shevchenko 2020-12-15 @162  		__builtin_choose_expr(					\
aa6159ab99a9ab Andy Shevchenko 2020-12-15  163  			__builtin_types_compatible_p(typeof(x), char),	\
aa6159ab99a9ab Andy Shevchenko 2020-12-15  164  			(char)({ signed char __x = (x); __x<0?-__x:__x; }), \
aa6159ab99a9ab Andy Shevchenko 2020-12-15  165  			((void)0)))))))
aa6159ab99a9ab Andy Shevchenko 2020-12-15  166  

:::::: The code at line 162 was first introduced by commit
:::::: aa6159ab99a9ab5df835b4750b66cf132a5aa292 kernel.h: split out mathematical helpers

:::::: TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-13 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 19:04 [lee-backlight:for-backlight-next 1/4] include/linux/math.h:162:17: error: first argument to '__builtin_choose_expr' not a constant kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.