[mmotm:master 441/471] arch/x86/kernel/cpu/perf_event_intel_rapl.c:132:27: sparse: incorrect type in initializer (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   f6bf2766c2091cbf8ffcc2c5009875dbdb678282
commit: 8fe1e4640220f24ca6d7c040d4849a8988ababf7 [441/471] x86: change __get_cpu_var calls introduced in 3.14
reproduce: make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> arch/x86/kernel/cpu/perf_event_intel_rapl.c:132:27: sparse: incorrect type in initializer (different address spaces)
   arch/x86/kernel/cpu/perf_event_intel_rapl.c:132:27:    expected void const [noderef] <asn:3>*__vpp_verify
   arch/x86/kernel/cpu/perf_event_intel_rapl.c:132:27:    got int *<noident>
>> arch/x86/kernel/cpu/perf_event_intel_rapl.c:444:30: sparse: symbol 'rapl_attr_groups' was not declared. Should it be static?
--
>> kernel/sched/deadline.c:1144:38: sparse: incorrect type in initializer (different address spaces)
   kernel/sched/deadline.c:1144:38:    expected void const [noderef] <asn:3>*__vpp_verify
   kernel/sched/deadline.c:1144:38:    got struct cpumask *<noident>
   kernel/sched/deadline.c:1183:9: sparse: incompatible types in comparison expression (different address spaces)

Please consider folding the attached diff :-)

vim +132 arch/x86/kernel/cpu/perf_event_intel_rapl.c

   116	
   117	static inline u64 rapl_read_counter(struct perf_event *event)
   118	{
   119		u64 raw;
   120		rdmsrl(event->hw.event_base, raw);
   121		return raw;
   122	}
   123	
   124	static inline u64 rapl_scale(u64 v)
   125	{
   126		/*
   127		 * scale delta to smallest unit (1/2^32)
   128		 * users must then scale back: count * 1/(1e9*2^32) to get Joules
   129		 * or use ldexp(count, -32).
   130		 * Watts = Joules/Time delta
   131		 */
 > 132		return v << (32 - __this_cpu_read(rapl_pmu->hw_unit));
   133	}
   134	
   135	static u64 rapl_event_update(struct perf_event *event)
   136	{
   137		struct hw_perf_event *hwc = &event->hw;
   138		u64 prev_raw_count, new_raw_count;
   139		s64 delta, sdelta;
   140		int shift = RAPL_CNTR_WIDTH;

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
From: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Subject: [PATCH mmotm] x86: rapl_attr_groups[] can be static
TO: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>
CC: Johannes Weiner <hannes@xxxxxxxxxxx>
CC: linux-kernel@xxxxxxxxxxxxxxx 

CC: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>
CC: Johannes Weiner <hannes@xxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
 perf_event_intel_rapl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
index d0dbcdf..cf4aaf3 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
@@ -441,7 +441,7 @@ static struct attribute_group rapl_pmu_format_group = {
 	.attrs = rapl_formats_attr,
 };
 
-const struct attribute_group *rapl_attr_groups[] = {
+static const struct attribute_group *rapl_attr_groups[] = {
 	&rapl_pmu_attr_group,
 	&rapl_pmu_format_group,
 	&rapl_pmu_events_group,

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]