Skip to contentSkip to conversation

smpboot: Place the __percpu annotation correctly

PATCH New Sebastian Andrzej Siewior 2 participants 2 messages Apr 24, 2019 CPU hotplug

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smpboot: Place the __percpu annotation correctly

The test robot reported a wrong assignment of a per-CPU variable which it detected by using sparse and sent a report. The assignment itself is correct. The annotation for sparse was wrong and hence the report. The first pointer is a "normal" pointer and points to the per-CPU memory area. That means that the __percpu annotation has to be moved.

Move the __percpu annotation to pointer which points to the per-CPU area. This change affects only the sparse tool (and is ignored by the compiler).

Fixes f97f8f06a49fe ("smpboot: Provide infrastructure for percpu hotplug threads")
---
 include/linux/smpboot.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/smpboot.h +1 -1
index d0884b5250010..9d1bc65d226cc 100644
@@ -29,7 +29,7 @@ struct smpboot_thread_data;
  * @thread_comm:	The base name of the thread
  */
 struct smp_hotplug_thread {
-	struct task_struct __percpu	**store;
+	struct task_struct		* __percpu *store;
 	struct list_head		list;
 	int				(*thread_should_run)(unsigned int cpu);
 	void				(*thread_fn)(unsigned int cpu);
Signature · 1 line
2.20.1
#1 lore raw
smpboot: Place the __percpu annotation correctly
Commit-ID:  d4645d30b50d1691c26ff0f8fa4e718b08f8d3bb
Gitweb:     https://git.kernel.org/tip/d4645d30b50d1691c26ff0f8fa4e718b08f8d3bb
Author:     Sebastian Andrzej Siewior <[email protected]>
AuthorDate: Wed, 24 Apr 2019 10:52:53 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 24 Apr 2019 12:17:08 +0200

smpboot: Place the __percpu annotation correctly

The test robot reported a wrong assignment of a per-CPU variable which it detected by using sparse and sent a report. The assignment itself is correct. The annotation for sparse was wrong and hence the report. The first pointer is a "normal" pointer and points to the per-CPU memory area. That means that the __percpu annotation has to be moved.

Move the __percpu annotation to pointer which points to the per-CPU area. This change affects only the sparse tool (and is ignored by the compiler).

Cc Linus Torvalds <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes f97f8f06a49fe ("smpboot: Provide infrastructure for percpu hotplug threads")
---
 include/linux/smpboot.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/smpboot.h +1 -1
index d0884b525001..9d1bc65d226c 100644
@@ -29,7 +29,7 @@ struct smpboot_thread_data;
  * @thread_comm:	The base name of the thread
  */
 struct smp_hotplug_thread {
-	struct task_struct __percpu	**store;
+	struct task_struct		* __percpu *store;
 	struct list_head		list;
 	int				(*thread_should_run)(unsigned int cpu);
 	void				(*thread_fn)(unsigned int cpu);