All of lore.kernel.org
 help / color / mirror / Atom feed
* [lee-leds:for-leds-next-next 2/2] drivers/leds/led-class-multicolor.c:51:24: error: call to '__compiletime_assert_210' declared with 'error' attribute: min(intensity_value[i], led_cdev->max_brightness) signedness error
@ 2026-03-06 10:20 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-06 10:20 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "__compiletime_assert_NNN"
:::::: 

BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
CC: linux-leds@vger.kernel.org
TO: Michael Tretter <m.tretter@pengutronix.de>
CC: Lee Jones <lee@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next-next
head:   787130d7bc49ec01604277a3480f42ba1557385e
commit: 787130d7bc49ec01604277a3480f42ba1557385e [2/2] leds: multicolor: Limit intensity to max_brightness of LED
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago
config: x86_64-buildonly-randconfig-003-20260306 (https://download.01.org/0day-ci/archive/20260306/202603061843.snQjuQDA-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260306/202603061843.snQjuQDA-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/r/202603061843.snQjuQDA-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/leds/led-class-multicolor.c:51:24: error: call to '__compiletime_assert_210' declared with 'error' attribute: min(intensity_value[i], led_cdev->max_brightness) signedness error
      51 |                 intensity_value[i] = min(intensity_value[i],
         |                                      ^
   include/linux/minmax.h:105:19: note: expanded from macro 'min'
     105 | #define min(x, y)       __careful_cmp(min, x, y)
         |                         ^
   include/linux/minmax.h:98:2: note: expanded from macro '__careful_cmp'
      98 |         __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
         |         ^
   include/linux/minmax.h:93:2: note: expanded from macro '__careful_cmp_once'
      93 |         BUILD_BUG_ON_MSG(!__types_ok(ux, uy),           \
         |         ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:694:2: note: expanded from macro '_compiletime_assert'
     694 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:687:4: note: expanded from macro '__compiletime_assert'
     687 |                         prefix ## suffix();                             \
         |                         ^
   <scratch space>:185:1: note: expanded from here
     185 | __compiletime_assert_210
         | ^
   1 error generated.


vim +51 drivers/leds/led-class-multicolor.c

55d5d3b46b08a4 Dan Murphy      2020-07-16  29  
55d5d3b46b08a4 Dan Murphy      2020-07-16  30  static ssize_t multi_intensity_store(struct device *dev,
55d5d3b46b08a4 Dan Murphy      2020-07-16  31  				struct device_attribute *intensity_attr,
55d5d3b46b08a4 Dan Murphy      2020-07-16  32  				const char *buf, size_t size)
55d5d3b46b08a4 Dan Murphy      2020-07-16  33  {
55d5d3b46b08a4 Dan Murphy      2020-07-16  34  	struct led_classdev *led_cdev = dev_get_drvdata(dev);
55d5d3b46b08a4 Dan Murphy      2020-07-16  35  	struct led_classdev_mc *mcled_cdev = lcdev_to_mccdev(led_cdev);
55d5d3b46b08a4 Dan Murphy      2020-07-16  36  	int nrchars, offset = 0;
55d5d3b46b08a4 Dan Murphy      2020-07-16  37  	int intensity_value[LED_COLOR_ID_MAX];
55d5d3b46b08a4 Dan Murphy      2020-07-16  38  	int i;
55d5d3b46b08a4 Dan Murphy      2020-07-16  39  	ssize_t ret;
55d5d3b46b08a4 Dan Murphy      2020-07-16  40  
55d5d3b46b08a4 Dan Murphy      2020-07-16  41  	mutex_lock(&led_cdev->led_access);
55d5d3b46b08a4 Dan Murphy      2020-07-16  42  
55d5d3b46b08a4 Dan Murphy      2020-07-16  43  	for (i = 0; i < mcled_cdev->num_colors; i++) {
55d5d3b46b08a4 Dan Murphy      2020-07-16  44  		ret = sscanf(buf + offset, "%i%n",
55d5d3b46b08a4 Dan Murphy      2020-07-16  45  			     &intensity_value[i], &nrchars);
55d5d3b46b08a4 Dan Murphy      2020-07-16  46  		if (ret != 1) {
55d5d3b46b08a4 Dan Murphy      2020-07-16  47  			ret = -EINVAL;
55d5d3b46b08a4 Dan Murphy      2020-07-16  48  			goto err_out;
55d5d3b46b08a4 Dan Murphy      2020-07-16  49  		}
55d5d3b46b08a4 Dan Murphy      2020-07-16  50  		offset += nrchars;
787130d7bc49ec Michael Tretter 2026-01-23 @51  		intensity_value[i] = min(intensity_value[i],
787130d7bc49ec Michael Tretter 2026-01-23  52  					 led_cdev->max_brightness);
55d5d3b46b08a4 Dan Murphy      2020-07-16  53  	}
55d5d3b46b08a4 Dan Murphy      2020-07-16  54  
55d5d3b46b08a4 Dan Murphy      2020-07-16  55  	offset++;
55d5d3b46b08a4 Dan Murphy      2020-07-16  56  	if (offset < size) {
55d5d3b46b08a4 Dan Murphy      2020-07-16  57  		ret = -EINVAL;
55d5d3b46b08a4 Dan Murphy      2020-07-16  58  		goto err_out;
55d5d3b46b08a4 Dan Murphy      2020-07-16  59  	}
55d5d3b46b08a4 Dan Murphy      2020-07-16  60  
55d5d3b46b08a4 Dan Murphy      2020-07-16  61  	for (i = 0; i < mcled_cdev->num_colors; i++)
55d5d3b46b08a4 Dan Murphy      2020-07-16  62  		mcled_cdev->subled_info[i].intensity = intensity_value[i];
55d5d3b46b08a4 Dan Murphy      2020-07-16  63  
e35ca991a777ef Sven Schwermer  2025-04-04  64  	if (!test_bit(LED_BLINK_SW, &led_cdev->work_flags))
55d5d3b46b08a4 Dan Murphy      2020-07-16  65  		led_set_brightness(led_cdev, led_cdev->brightness);
55d5d3b46b08a4 Dan Murphy      2020-07-16  66  	ret = size;
55d5d3b46b08a4 Dan Murphy      2020-07-16  67  err_out:
55d5d3b46b08a4 Dan Murphy      2020-07-16  68  	mutex_unlock(&led_cdev->led_access);
55d5d3b46b08a4 Dan Murphy      2020-07-16  69  	return ret;
55d5d3b46b08a4 Dan Murphy      2020-07-16  70  }
55d5d3b46b08a4 Dan Murphy      2020-07-16  71  

-- 
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:[~2026-03-06 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 10:20 [lee-leds:for-leds-next-next 2/2] drivers/leds/led-class-multicolor.c:51:24: error: call to '__compiletime_assert_210' declared with 'error' attribute: min(intensity_value[i], led_cdev->max_brightness) signedness error 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.