[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202506170238.VtqmOKaK-lkp@intel.com>
Date: Tue, 17 Jun 2025 02:37:37 +0800
From: kernel test robot <lkp@...el.com>
To: Nam Tran <trannamatk@...il.com>, lee@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, pavel@...nel.org, krzk+dt@...nel.org,
robh@...nel.org, conor+dt@...nel.org, corbet@....net,
linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
Nam Tran <trannamatk@...il.com>
Subject: Re: [PATCH v9 2/4] leds: add TI/National Semiconductor LP5812 LED
Driver
Hi Nam,
kernel test robot noticed the following build warnings:
[auto build test WARNING on f09079bd04a924c72d555cd97942d5f8d7eca98c]
url: https://github.com/intel-lab-lkp/linux/commits/Nam-Tran/dt-bindings-leds-add-TI-National-Semiconductor-LP5812-LED-Driver/20250611-100314
base: f09079bd04a924c72d555cd97942d5f8d7eca98c
patch link: https://lore.kernel.org/r/20250610174319.183375-4-trannamatk%40gmail.com
patch subject: [PATCH v9 2/4] leds: add TI/National Semiconductor LP5812 LED Driver
config: x86_64-randconfig-002-20250617 (https://download.01.org/0day-ci/archive/20250617/202506170238.VtqmOKaK-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250617/202506170238.VtqmOKaK-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506170238.VtqmOKaK-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/leds/rgb/leds-lp5812.c: In function 'lp5812_init_led.isra':
>> drivers/leds/rgb/leds-lp5812.c:1585:57: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 5 and 24 [-Wformat-truncation=]
1585 | snprintf(name, sizeof(name), "%s:channel%d",
| ^~
drivers/leds/rgb/leds-lp5812.c:1585:46: note: directive argument in the range [0, 2147483647]
1585 | snprintf(name, sizeof(name), "%s:channel%d",
| ^~~~~~~~~~~~~~
drivers/leds/rgb/leds-lp5812.c:1585:17: note: 'snprintf' output between 10 and 38 bytes into a destination of size 32
1585 | snprintf(name, sizeof(name), "%s:channel%d",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1586 | pdata->label ? : chip->i2c_cl->name, chan);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +1585 drivers/leds/rgb/leds-lp5812.c
1572
1573 static int lp5812_init_led(struct lp5812_led *led, struct lp5812_chip *chip, int chan)
1574 {
1575 struct lp5812_data *pdata = chip->pdata;
1576 struct device *dev = &chip->i2c_cl->dev;
1577 struct mc_subled *mc_led_info;
1578 struct led_classdev *led_cdev;
1579 char name[32];
1580 int i, ret = 0;
1581
1582 if (pdata->led_config[chan].name) {
1583 led->cdev.name = pdata->led_config[chan].name;
1584 } else {
> 1585 snprintf(name, sizeof(name), "%s:channel%d",
1586 pdata->label ? : chip->i2c_cl->name, chan);
1587 led->cdev.name = name;
1588 }
1589
1590 if (pdata->led_config[chan].is_sc_led == 0) {
1591 mc_led_info = devm_kcalloc(dev,
1592 pdata->led_config[chan].num_colors,
1593 sizeof(*mc_led_info), GFP_KERNEL);
1594 if (!mc_led_info)
1595 return -ENOMEM;
1596
1597 led_cdev = &led->mc_cdev.led_cdev;
1598 led_cdev->name = led->cdev.name;
1599 led_cdev->brightness_set_blocking = lp5812_set_mc_brightness;
1600 led->mc_cdev.num_colors = pdata->led_config[chan].num_colors;
1601 for (i = 0; i < led->mc_cdev.num_colors; i++) {
1602 mc_led_info[i].color_index =
1603 pdata->led_config[chan].color_id[i];
1604 mc_led_info[i].channel =
1605 pdata->led_config[chan].led_id[i];
1606 }
1607
1608 led->mc_cdev.subled_info = mc_led_info;
1609 } else {
1610 led->cdev.brightness_set_blocking = lp5812_set_brightness;
1611 }
1612
1613 led->cdev.groups = lp5812_led_groups;
1614 led->chan_nr = chan;
1615
1616 if (pdata->led_config[chan].is_sc_led) {
1617 ret = devm_led_classdev_register(dev, &led->cdev);
1618 if (ret == 0) {
1619 led->cdev.dev->platform_data = devm_kstrdup(dev, LP5812_SC_LED, GFP_KERNEL);
1620 if (!led->cdev.dev->platform_data)
1621 return -ENOMEM;
1622 }
1623 } else {
1624 ret = devm_led_classdev_multicolor_register(dev, &led->mc_cdev);
1625 if (ret == 0) {
1626 led->mc_cdev.led_cdev.dev->platform_data =
1627 devm_kstrdup(dev, LP5812_MC_LED, GFP_KERNEL);
1628 if (!led->mc_cdev.led_cdev.dev->platform_data)
1629 return -ENOMEM;
1630
1631 ret = sysfs_create_groups(&led->mc_cdev.led_cdev.dev->kobj,
1632 lp5812_led_groups);
1633 if (ret)
1634 dev_err(dev, "sysfs_create_groups failed\n");
1635 }
1636 }
1637
1638 if (ret) {
1639 dev_err(dev, "led register err: %d\n", ret);
1640 return ret;
1641 }
1642
1643 return 0;
1644 }
1645
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists