All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nam Tran <trannamatk@gmail.com>, lee@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, pavel@kernel.org,
	krzk+dt@kernel.org, robh@kernel.org, conor+dt@kernel.org,
	corbet@lwn.net, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, Nam Tran <trannamatk@gmail.com>
Subject: Re: [PATCH v9 2/4] leds: add TI/National Semiconductor LP5812 LED Driver
Date: Tue, 17 Jun 2025 02:37:37 +0800	[thread overview]
Message-ID: <202506170238.VtqmOKaK-lkp@intel.com> (raw)
In-Reply-To: <20250610174319.183375-4-trannamatk@gmail.com>

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@intel.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

  parent reply	other threads:[~2025-06-16 18:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 17:43 [PATCH v9 0/4] leds: add new LED driver for TI LP5812 Nam Tran
2025-06-10 17:43 ` [PATCH v9 1/4] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver Nam Tran
2025-06-11  8:24   ` Krzysztof Kozlowski
2025-06-17 16:29     ` Nam Tran
2025-06-10 17:43 ` [PATCH v5] test Nam Tran
2025-06-12 10:03   ` Lee Jones
2025-06-17 17:46     ` Nam Tran
2025-06-10 17:43 ` [PATCH v9 2/4] leds: add TI/National Semiconductor LP5812 LED Driver Nam Tran
2025-06-10 18:13   ` Randy Dunlap
2025-06-17 16:50     ` Nam Tran
2025-06-10 21:07   ` Christophe JAILLET
2025-06-17 17:30     ` Nam Tran
2025-06-16 18:37   ` kernel test robot [this message]
2025-06-10 17:43 ` [PATCH v9 3/4] docs: ABI: Document LP5812 LED sysfs interfaces Nam Tran
2025-06-10 17:43 ` [PATCH v9 4/4] docs: leds: Document TI LP5812 LED driver Nam Tran
2025-06-10 17:55 ` [PATCH v9 0/4] leds: add new LED driver for TI LP5812 Nam Tran
2025-06-11  6:59 ` Krzysztof Kozlowski
2025-06-17 15:40   ` Nam Tran
  -- strict thread matches above, loose matches on Subject: below --
2025-06-13 14:50 [PATCH v9 2/4] leds: add TI/National Semiconductor LP5812 LED Driver kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202506170238.VtqmOKaK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pavel@kernel.org \
    --cc=robh@kernel.org \
    --cc=trannamatk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.