public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] leds: add mp3326 driver
       [not found] <20231108032921.3134115-3-wyx137120466@gmail.com>
@ 2023-11-12 11:21 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-11-12 11:21 UTC (permalink / raw)
  To: Yuxi Wang, pavel, lee, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	Yuxi.Wang
  Cc: llvm, oe-kbuild-all, linux-leds, devicetree, linux-kernel

Hi Yuxi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on lee-leds/for-leds-next]
[also build test WARNING on robh/for-next pavel-leds/for-next linus/master v6.6 next-20231110]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yuxi-Wang/dt-bindings-leds-add-mps-mp3326-LED/20231108-113235
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link:    https://lore.kernel.org/r/20231108032921.3134115-3-wyx137120466%40gmail.com
patch subject: [PATCH 2/2] leds: add mp3326 driver
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20231112/202311121908.Kyj8FdWx-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231112/202311121908.Kyj8FdWx-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/202311121908.Kyj8FdWx-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/leds/leds-mp3326.c:490:9: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
     490 |                         info[i].color_index = color;
         |                              ^
   drivers/leds/leds-mp3326.c:449:7: note: initialize the variable 'i' to silence this warning
     449 |         int i;
         |              ^
         |               = 0
   drivers/leds/leds-mp3326.c:546:37: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
     546 |                 ret = mp3326_add_led(chip, child, i);
         |                                                   ^
   drivers/leds/leds-mp3326.c:542:7: note: initialize the variable 'i' to silence this warning
     542 |         int i;
         |              ^
         |               = 0
   2 warnings generated.


vim +/i +490 drivers/leds/leds-mp3326.c

   440	
   441	static int mp3326_add_led(struct mp3326 *chip, struct device_node *np, int index)
   442	{
   443		struct mp3326_led *led = &chip->leds[index];
   444		struct mc_subled *info;
   445		struct device_node *child;
   446		struct led_classdev *cdev;
   447		struct led_init_data init_data = {};
   448		int ret;
   449		int i;
   450		int count;
   451		u32 color = 0;
   452		u32 reg = 0;
   453	
   454		ret = of_property_read_u32(np, "color", &color);
   455		if (ret) {
   456			dev_err(&chip->client->dev, "Miss color in the node\n");
   457			return ret;
   458		}
   459		led->private_data = chip;
   460		if (color == LED_COLOR_ID_RGB) {
   461			count = of_get_child_count(np);
   462			if (count != 3) {
   463				dev_err(&chip->client->dev, "RGB must have three node.\n");
   464				return -EINVAL;
   465			}
   466	
   467			info = devm_kcalloc(&chip->client->dev, 3, sizeof(*info), GFP_KERNEL);
   468			if (!info)
   469				return -ENOMEM;
   470	
   471			for_each_available_child_of_node(np, child) {
   472				ret = of_property_read_u32(child, "reg", &reg);
   473				if (ret || reg > MAX_CHANNEL) {
   474					dev_err(&chip->client->dev,
   475					"reg must less or equal than %d\n", MAX_CHANNEL);
   476					return -EINVAL;
   477				}
   478	
   479				ret = of_property_read_u32(child, "color", &color);
   480				if (ret) {
   481					dev_err(&chip->client->dev, "color must have value\n");
   482					return ret;
   483				}
   484	
   485				if (color > 3 || !color) {
   486					dev_err(&chip->client->dev,
   487					"color must be Red, Green and Blue. The color is %d\n", color);
   488					return ret;
   489				}
 > 490				info[i].color_index = color;
   491				info[i].channel = reg - 1;
   492				info[i].brightness = 0;
   493				i++;
   494			}
   495	
   496			led->subled_info = info;
   497			led->num_colors = 3;
   498			cdev = &led->cdev;
   499			cdev->max_brightness = MAX_BRIGHTNESS;
   500			cdev->brightness_set_blocking = led_brightness_set;
   501			cdev->groups = led_sysfs_groups;
   502			init_data.fwnode = &np->fwnode;
   503	
   504			ret = devm_led_classdev_register_ext(&chip->client->dev, &led->cdev, &init_data);
   505	
   506			if (ret) {
   507				dev_err(&chip->client->dev, "Unable register multicolor:%s\n", cdev->name);
   508				return ret;
   509			}
   510		} else {
   511			ret = of_property_read_u32(np, "reg", &reg);
   512			if (ret || reg > MAX_CHANNEL) {
   513				dev_err(&chip->client->dev,
   514				"reg must less or equal than %d\n", MAX_CHANNEL);
   515				return -EINVAL;
   516			}
   517			info = devm_kcalloc(&chip->client->dev, 1, sizeof(*info), GFP_KERNEL);
   518			led->num_colors = 1;
   519			info[i].color_index = LED_COLOR_ID_WHITE;
   520			info[i].channel = reg - 1;
   521			info[i].brightness = 0;
   522			led->subled_info = info;
   523			cdev = &led->cdev;
   524			cdev->max_brightness = MAX_BRIGHTNESS;
   525			cdev->brightness_set_blocking = led_brightness_set;
   526			cdev->groups = led_sysfs_groups;
   527			init_data.fwnode = &np->fwnode;
   528			ret = devm_led_classdev_register_ext(&chip->client->dev, &led->cdev, &init_data);
   529			if (ret) {
   530				dev_err(&chip->client->dev, "Unable register led:%s\n", cdev->name);
   531				return ret;
   532			}
   533		}
   534		return ret;
   535	}
   536	

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

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

* Re: [PATCH 2/2] leds: add mp3326 driver
       [not found] <20231124093034.951-3-Yuxi.Wang@monolithicpower.com>
@ 2023-11-25 20:00 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-11-25 20:00 UTC (permalink / raw)
  To: Yuxi Wang, pavel, lee, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: llvm, oe-kbuild-all, linux-kernel, linux-leds, devicetree,
	wyx137120466

Hi Yuxi,

kernel test robot noticed the following build errors:

[auto build test ERROR on lee-leds/for-leds-next]
[also build test ERROR on robh/for-next linus/master v6.7-rc2 next-20231124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yuxi-Wang/dt-bindings-leds-add-mps-mp3326-LED/20231124-173610
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link:    https://lore.kernel.org/r/20231124093034.951-3-Yuxi.Wang%40monolithicpower.com
patch subject: [PATCH 2/2] leds: add mp3326 driver
config: i386-buildonly-randconfig-005-20231126 (https://download.01.org/0day-ci/archive/20231126/202311260229.JhaLyLj7-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231126/202311260229.JhaLyLj7-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/202311260229.JhaLyLj7-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/leds/leds-mp3326.c:543:6: warning: unused variable 'val' [-Wunused-variable]
           int val;
               ^
   drivers/leds/leds-mp3326.c:611:3: error: field designator 'probe_new' does not refer to any field in type 'struct i2c_driver'
           .probe_new = mp3326_leds_probe,
            ^
>> drivers/leds/leds-mp3326.c:619:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
   module_i2c_driver(mp3326_driver);
   ^
   int
>> drivers/leds/leds-mp3326.c:619:19: error: a parameter list without types is only allowed in a function definition
   module_i2c_driver(mp3326_driver);
                     ^
   1 warning and 3 errors generated.


vim +/int +619 drivers/leds/leds-mp3326.c

   618	
 > 619	module_i2c_driver(mp3326_driver);

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

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

end of thread, other threads:[~2023-11-25 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20231108032921.3134115-3-wyx137120466@gmail.com>
2023-11-12 11:21 ` [PATCH 2/2] leds: add mp3326 driver kernel test robot
     [not found] <20231124093034.951-3-Yuxi.Wang@monolithicpower.com>
2023-11-25 20:00 ` kernel test robot

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