sched/topology: Fix percpu data types in struct sd_data & struct s_data
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Fri, 18 Jan 2019 14:49:36 +0000 (15:49 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 11 Feb 2019 07:02:15 +0000 (08:02 +0100)
The percpu members of struct sd_data and s_data are declared as:

struct ... ** __percpu member;

So their type is:

__percpu pointer to pointer to struct ...

But looking at how they're used, their type should be:

pointer to __percpu pointer to struct ...

and they should thus be declared as:

struct ... * __percpu *member;

So fix the placement of '__percpu' in the definition of these
structures.

This addresses a bunch of Sparse's warnings like:

warning: incorrect type in initializer (different address spaces)
  expected void const [noderef] <asn:3> *__vpp_verify
  got struct sched_domain **

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190118144936.79158-1-luc.vanoostenryck@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/sched/topology.h
kernel/sched/topology.c

index c31d3a47a47cc57478a25c0738cb7224a158c30e..57c7ed3fe46590cd6d4efe387b2133911bb293ed 100644 (file)
@@ -176,10 +176,10 @@ typedef int (*sched_domain_flags_f)(void);
 #define SDTL_OVERLAP   0x01
 
 struct sd_data {
-       struct sched_domain **__percpu sd;
-       struct sched_domain_shared **__percpu sds;
-       struct sched_group **__percpu sg;
-       struct sched_group_capacity **__percpu sgc;
+       struct sched_domain *__percpu *sd;
+       struct sched_domain_shared *__percpu *sds;
+       struct sched_group *__percpu *sg;
+       struct sched_group_capacity *__percpu *sgc;
 };
 
 struct sched_domain_topology_level {
index 4ae9403420edccb07ff90ddf9fa1681fecb2e458..93ff526e77b089318db3eb32b3bd03d8e312ac81 100644 (file)
@@ -705,7 +705,7 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 }
 
 struct s_data {
-       struct sched_domain ** __percpu sd;
+       struct sched_domain * __percpu *sd;
        struct root_domain      *rd;
 };