Skip to contentSkip to conversation

kernel/workqueue.c:6798:32: error: passing 'const struct bus_type *' to parameter of type 'struct bus_type *' discards qualifiers

PATCH New kernel test robot 3 participants 5 messages Feb 5, 2024 – Feb 6, 2024

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   23e11d0318521e8693459b0e4d23aec614b3b68b
commit: d412ace11144aa2bf692c7cf9778351efc15c827 [3841/4021] workqueue: make wq_subsys const
config: i386-buildonly-randconfig-003-20240205 (https://download.01.org/0day-ci/archive/20240205/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240205/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Note: the linux-next/master HEAD 23e11d0318521e8693459b0e4d23aec614b3b68b builds fine.
It may have been fixed somewhere.

All errors (new ones prefixed by >>):

>> kernel/workqueue.c:6798:32: error: passing 'const struct bus_type *' to parameter of type 'struct bus_type *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    6798 |         err = subsys_virtual_register(&wq_subsys, NULL);
         |                                       ^~~~~~~~~~

include/linux/device.h:77:46: note: passing argument to parameter 'subsys' here
77 | int subsys_virtual_register(struct bus_type *subsys,
| ^
1 error generated.

vim +6798 kernel/workqueue.c

b05a79280b346e Frederic Weisbecker 2015-04-27  6792  
6ba94429c8e7b8 Frederic Weisbecker 2015-04-02  6793  static int __init wq_sysfs_init(void)
2d3854a37e8b76 Rusty Russell       2008-11-05  6794  {
686f669780276d Greg Kroah-Hartman  2023-03-13  6795  	struct device *dev_root;
b05a79280b346e Frederic Weisbecker 2015-04-27  6796  	int err;
b05a79280b346e Frederic Weisbecker 2015-04-27  6797  
b05a79280b346e Frederic Weisbecker 2015-04-27 @6798  	err = subsys_virtual_register(&wq_subsys, NULL);
b05a79280b346e Frederic Weisbecker 2015-04-27  6799  	if (err)
b05a79280b346e Frederic Weisbecker 2015-04-27  6800  		return err;
b05a79280b346e Frederic Weisbecker 2015-04-27  6801  
686f669780276d Greg Kroah-Hartman  2023-03-13  6802  	dev_root = bus_get_dev_root(&wq_subsys);
686f669780276d Greg Kroah-Hartman  2023-03-13  6803  	if (dev_root) {
fe28f631fa941f Waiman Long         2023-10-25  6804  		struct device_attribute *attr;
fe28f631fa941f Waiman Long         2023-10-25  6805  
fe28f631fa941f Waiman Long         2023-10-25  6806  		for (attr = wq_sysfs_cpumask_attrs; attr->attr.name; attr++) {
fe28f631fa941f Waiman Long         2023-10-25  6807  			err = device_create_file(dev_root, attr);
fe28f631fa941f Waiman Long         2023-10-25  6808  			if (err)
fe28f631fa941f Waiman Long         2023-10-25  6809  				break;
fe28f631fa941f Waiman Long         2023-10-25  6810  		}
686f669780276d Greg Kroah-Hartman  2023-03-13  6811  		put_device(dev_root);
686f669780276d Greg Kroah-Hartman  2023-03-13  6812  	}
686f669780276d Greg Kroah-Hartman  2023-03-13  6813  	return err;
2d3854a37e8b76 Rusty Russell       2008-11-05  6814  }
6ba94429c8e7b8 Frederic Weisbecker 2015-04-02  6815  core_initcall(wq_sysfs_init);
2d3854a37e8b76 Rusty Russell       2008-11-05  6816  

:::::: The code at line 6798 was first introduced by commit
:::::: b05a79280b346eb24ddb73b39988398015291075 workqueue: Create low-level unbound workqueues cpumask

:::::: TO: Frederic Weisbecker <[email protected]> :::::: CC: Tejun Heo <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 15 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   23e11d0318521e8693459b0e4d23aec614b3b68b
commit: d412ace11144aa2bf692c7cf9778351efc15c827 [3841/4021] workqueue: make wq_subsys const
config: i386-buildonly-randconfig-003-20240205 (https://download.01.org/0day-ci/archive/20240205/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240205/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Note: the linux-next/master HEAD 23e11d0318521e8693459b0e4d23aec614b3b68b builds fine.
It may have been fixed somewhere.

Quoted 7 lines

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/workqueue.c:6798:32: error: passing 'const struct bus_type *' to parameter of type 'struct bus_type *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

    6798 |         err = subsys_virtual_register(&wq_subsys, NULL);
         |                                       ^~~~~~~~~~

include/linux/device.h:77:46: note: passing argument to parameter 'subsys' here
77 | int subsys_virtual_register(struct bus_type *subsys,

I'm not sure how to flag this as invalid, since this is fixed already in 32f78abe59c7 ("driver core: bus: constantify subsys_register() calls")

Quoted 41 lines

| ^
1 error generated.

vim +6798 kernel/workqueue.c

b05a79280b346e Frederic Weisbecker 2015-04-27  6792  
6ba94429c8e7b8 Frederic Weisbecker 2015-04-02  6793  static int __init wq_sysfs_init(void)
2d3854a37e8b76 Rusty Russell       2008-11-05  6794  {
686f669780276d Greg Kroah-Hartman  2023-03-13  6795  	struct device *dev_root;
b05a79280b346e Frederic Weisbecker 2015-04-27  6796  	int err;
b05a79280b346e Frederic Weisbecker 2015-04-27  6797  
b05a79280b346e Frederic Weisbecker 2015-04-27 @6798  	err = subsys_virtual_register(&wq_subsys, NULL);
b05a79280b346e Frederic Weisbecker 2015-04-27  6799  	if (err)
b05a79280b346e Frederic Weisbecker 2015-04-27  6800  		return err;
b05a79280b346e Frederic Weisbecker 2015-04-27  6801  
686f669780276d Greg Kroah-Hartman  2023-03-13  6802  	dev_root = bus_get_dev_root(&wq_subsys);
686f669780276d Greg Kroah-Hartman  2023-03-13  6803  	if (dev_root) {
fe28f631fa941f Waiman Long         2023-10-25  6804  		struct device_attribute *attr;
fe28f631fa941f Waiman Long         2023-10-25  6805  
fe28f631fa941f Waiman Long         2023-10-25  6806  		for (attr = wq_sysfs_cpumask_attrs; attr->attr.name; attr++) {
fe28f631fa941f Waiman Long         2023-10-25  6807  			err = device_create_file(dev_root, attr);
fe28f631fa941f Waiman Long         2023-10-25  6808  			if (err)
fe28f631fa941f Waiman Long         2023-10-25  6809  				break;
fe28f631fa941f Waiman Long         2023-10-25  6810  		}
686f669780276d Greg Kroah-Hartman  2023-03-13  6811  		put_device(dev_root);
686f669780276d Greg Kroah-Hartman  2023-03-13  6812  	}
686f669780276d Greg Kroah-Hartman  2023-03-13  6813  	return err;
2d3854a37e8b76 Rusty Russell       2008-11-05  6814  }
6ba94429c8e7b8 Frederic Weisbecker 2015-04-02  6815  core_initcall(wq_sysfs_init);
2d3854a37e8b76 Rusty Russell       2008-11-05  6816  

:::::: The code at line 6798 was first introduced by commit
:::::: b05a79280b346eb24ddb73b39988398015291075 workqueue: Create low-level unbound workqueues cpumask

:::::: TO: Frederic Weisbecker <[email protected]> :::::: CC: Tejun Heo <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#2 lore raw

Hello, Ricardo.

Quoted 2 lines · Ricardo B. Marliere

I'm not sure how to flag this as invalid, since this is fixed already in 32f78abe59c7 ("driver core: bus: constantify subsys_register() calls")

So, when there are cross-tree dependencies, it's best to note them when sending out the patch so that the preparatory pulls can be made to avoid breaking the applying trees. I just reverted the patch for now and think it'd be best to route this patch through the driver-core tree. Can you please repost the patch and ask Greg to apply it.

Thanks.

Signature · 1 line
tejun
#3 lore raw

Hi Tejun,

Quoted 11 lines · Tejun Heo

Hello, Ricardo.

Quoted 2 lines · Ricardo B. Marliere

I'm not sure how to flag this as invalid, since this is fixed already in 32f78abe59c7 ("driver core: bus: constantify subsys_register() calls")

So, when there are cross-tree dependencies, it's best to note them when sending out the patch so that the preparatory pulls can be made to avoid breaking the applying trees. I just reverted the patch for now and think it'd be best to route this patch through the driver-core tree. Can you please repost the patch and ask Greg to apply it.

Sorry for that, I'll resend to Greg then.

Thank you,
- Ricardo.

Quoted 5 lines

Thanks.

Signature · 1 line
tejun
maintainer
#4 lore raw

PATCH 1/1 Revert "workqueue: make wq_subsys const"

In reply to kernel test robot

From 4f19b8e01e2fb6c97d4307abb7bde4d34a1e601e Mon Sep 17 00:00:00 2001
From: Tejun Heo <[email protected]>
Date: Mon, 5 Feb 2024 07:18:08 -1000

This reverts commit d412ace11144aa2bf692c7cf9778351efc15c827. This leads to build failures as it depends on a driver-core commit 32f78abe59c7 ("driver
core: bus: constantify subsys_register() calls"). Let's drop it from wq tree and route it through driver-core tree.

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index 78b4b992e1a3..524a7fff52af 100644
@@ -6874,7 +6874,7 @@ static struct device_attribute wq_sysfs_unbound_attrs[] = {
 	__ATTR_NULL,
 };
 
-static const struct bus_type wq_subsys = {
+static struct bus_type wq_subsys = {
 	.name				= "workqueue",
 	.dev_groups			= wq_sysfs_groups,
 };
Signature · 1 line
2.43.0