Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v3 4/4] leds: Add virtualcolor LED group driver
       [not found] <20251019092331.49531-5-professorjonny98@gmail.com>
@ 2025-10-20  3:29 ` kernel test robot
  2025-10-22 16:19   ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-10-20  3:29 UTC (permalink / raw)
  To: Jonathan Brophy, lee Jones, Pavel Machek, Jonathan Brophy,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Radoslav Tsvetkov
  Cc: llvm, oe-kbuild-all, devicetree, linux-kernel, linux-leds

Hi Jonathan,

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 linus/master v6.18-rc2 next-20251017]
[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/Jonathan-Brophy/dt-bindings-Add-virtualcolor-class-dt-bindings-documentation/20251019-172647
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link:    https://lore.kernel.org/r/20251019092331.49531-5-professorjonny98%40gmail.com
patch subject: [PATCH v3 4/4] leds: Add virtualcolor LED group driver
config: i386-randconfig-001-20251020 (https://download.01.org/0day-ci/archive/20251020/202510201144.TwTDnjSJ-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/20251020/202510201144.TwTDnjSJ-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/202510201144.TwTDnjSJ-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/leds/rgb/leds-group-virtualcolor.c:463:38: warning: cast from 'void (*)(struct mutex *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
     463 |         ret = devm_add_action_or_reset(dev, (void (*)(void *))mutex_destroy,
         |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/device/devres.h:166:34: note: expanded from macro 'devm_add_action_or_reset'
     166 |         __devm_add_action_or_reset(dev, action, data, #action)
         |                                         ^~~~~~
   1 warning generated.


vim +463 drivers/leds/rgb/leds-group-virtualcolor.c

   449	
   450	static int leds_virtualcolor_probe(struct platform_device *pdev)
   451	{
   452		struct leds_virtualcolor *vc_data;
   453		struct device *dev = &pdev->dev;
   454		int count = 0;
   455		int ret;
   456	
   457		vc_data = devm_kzalloc(dev, sizeof(*vc_data), GFP_KERNEL);
   458		if (!vc_data)
   459			return -ENOMEM;
   460	
   461		mutex_init(&vc_data->lock);
   462	
 > 463		ret = devm_add_action_or_reset(dev, (void (*)(void *))mutex_destroy,
   464					       &vc_data->lock);
   465		if (ret)
   466			return ret;
   467	
   468		INIT_LIST_HEAD(&vc_data->active_leds);
   469	
   470		vc_data->num_vleds = of_get_child_count(dev->of_node);
   471		if (vc_data->num_vleds == 0) {
   472			dev_err(dev, "No virtual LEDs defined\n");
   473			return -EINVAL;
   474		}
   475	
   476		vc_data->vleds = devm_kcalloc(dev, vc_data->num_vleds, sizeof(*vc_data->vleds), GFP_KERNEL);
   477		if (!vc_data->vleds)
   478			return -ENOMEM;
   479	
   480		for_each_available_child_of_node_scoped(dev->of_node, child) {
   481			struct virtual_led *vled = &vc_data->vleds[count];
   482	
   483			ret = leds_virtualcolor_init_vled(dev, child, vled, vc_data);
   484			if (ret)
   485				return ret;
   486	
   487			count++;
   488		}
   489	
   490		platform_set_drvdata(pdev, vc_data);
   491	
   492		return 0;
   493	}
   494	

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

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

* Re: [PATCH v3 4/4] leds: Add virtualcolor LED group driver
  2025-10-20  3:29 ` [PATCH v3 4/4] leds: Add virtualcolor LED group driver kernel test robot
@ 2025-10-22 16:19   ` Nathan Chancellor
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2025-10-22 16:19 UTC (permalink / raw)
  To: kernel test robot
  Cc: Jonathan Brophy, lee Jones, Pavel Machek, Jonathan Brophy,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Radoslav Tsvetkov,
	llvm, oe-kbuild-all, devicetree, linux-kernel, linux-leds

On Mon, Oct 20, 2025 at 11:29:28AM +0800, kernel test robot wrote:
...
> url:    https://github.com/intel-lab-lkp/linux/commits/Jonathan-Brophy/dt-bindings-Add-virtualcolor-class-dt-bindings-documentation/20251019-172647
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
> patch link:    https://lore.kernel.org/r/20251019092331.49531-5-professorjonny98%40gmail.com
> patch subject: [PATCH v3 4/4] leds: Add virtualcolor LED group driver
> config: i386-randconfig-001-20251020 (https://download.01.org/0day-ci/archive/20251020/202510201144.TwTDnjSJ-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/20251020/202510201144.TwTDnjSJ-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/202510201144.TwTDnjSJ-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/leds/rgb/leds-group-virtualcolor.c:463:38: warning: cast from 'void (*)(struct mutex *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
>      463 |         ret = devm_add_action_or_reset(dev, (void (*)(void *))mutex_destroy,
>          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/device/devres.h:166:34: note: expanded from macro 'devm_add_action_or_reset'
>      166 |         __devm_add_action_or_reset(dev, action, data, #action)
>          |                                         ^~~~~~
>    1 warning generated.

This should use a dedicated wrapper function like a patch that I just
sent for the same issue in another driver [1] to avoid a kernel control
flow integrity violation at run time with CONFIG_CFI=y.

[1]: https://lore.kernel.org/20251022-ishtp-fix-function-cast-warn-v1-1-bfb06464f8ca@kernel.org/

Cheers,
Nathan

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

end of thread, other threads:[~2025-10-22 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251019092331.49531-5-professorjonny98@gmail.com>
2025-10-20  3:29 ` [PATCH v3 4/4] leds: Add virtualcolor LED group driver kernel test robot
2025-10-22 16:19   ` Nathan Chancellor

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