Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched: Fix compiler warnings

Commit 143e1e28cb (sched: Rework sched_domain topology definition)
introduced a number of functions with a return value of 'const int'.
gcc doesn't know what to do with that and, if the kernel is compiled
with W=1, complains with the following warnings whenever sched.h
is included.

include/linux/sched.h:875:25: warning: type qualifiers ignored on function return type
include/linux/sched.h:882:25: warning: type qualifiers ignored on function return type
include/linux/sched.h:889:25: warning: type qualifiers ignored on function return type
include/linux/sched.h:1002:21: warning: type qualifiers ignored on function return type

Commits fb2aa855 (sched, ARM: Create a dedicated scheduler topology table)
and 607b45e9a (sched, powerpc: Create a dedicated topology table) introduce
the same warning in the arm and powerpc code.

Drop 'const' from the function declarations to fix the problem.

The fix for all three patches has to be applied together to avoid
compilation failures for the affected architectures.

Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1403658329-13196-1-git-send-email-linux@roeck-us.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Guenter Roeck and committed by
Ingo Molnar
b6220ad6 3896c329

+6 -6
+1 -1
arch/arm/kernel/topology.c
··· 275 275 cpu_topology[cpuid].socket_id, mpidr); 276 276 } 277 277 278 - static inline const int cpu_corepower_flags(void) 278 + static inline int cpu_corepower_flags(void) 279 279 { 280 280 return SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN; 281 281 }
+1 -1
arch/powerpc/kernel/smp.c
··· 747 747 748 748 #ifdef CONFIG_SCHED_SMT 749 749 /* cpumask of CPUs with asymetric SMT dependancy */ 750 - static const int powerpc_smt_flags(void) 750 + static int powerpc_smt_flags(void) 751 751 { 752 752 int flags = SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; 753 753
+4 -4
include/linux/sched.h
··· 872 872 #define SD_NUMA 0x4000 /* cross-node balancing */ 873 873 874 874 #ifdef CONFIG_SCHED_SMT 875 - static inline const int cpu_smt_flags(void) 875 + static inline int cpu_smt_flags(void) 876 876 { 877 877 return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; 878 878 } 879 879 #endif 880 880 881 881 #ifdef CONFIG_SCHED_MC 882 - static inline const int cpu_core_flags(void) 882 + static inline int cpu_core_flags(void) 883 883 { 884 884 return SD_SHARE_PKG_RESOURCES; 885 885 } 886 886 #endif 887 887 888 888 #ifdef CONFIG_NUMA 889 - static inline const int cpu_numa_flags(void) 889 + static inline int cpu_numa_flags(void) 890 890 { 891 891 return SD_NUMA; 892 892 } ··· 999 999 bool cpus_share_cache(int this_cpu, int that_cpu); 1000 1000 1001 1001 typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); 1002 - typedef const int (*sched_domain_flags_f)(void); 1002 + typedef int (*sched_domain_flags_f)(void); 1003 1003 1004 1004 #define SDTL_OVERLAP 0x01 1005 1005