diff options
author | Tejun Heo <tj@kernel.org> | 2010-02-16 20:50:50 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-02-27 10:23:39 -0500 |
commit | 44ee63587dce85593c22497140db16f4e5027860 (patch) | |
tree | 0b3d45f9755080f1c7362a8a2eb69e326b0e2f85 /include | |
parent | 018cbffe6819f6f8db20a0a3acd9bab9bfd667e4 (diff) |
percpu: Add __percpu sparse annotations to hw_breakpoint
Add __percpu sparse annotations to hw_breakpoint.
These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors. This patch doesn't affect normal builds.
In kernel/hw_breakpoint.c, per_cpu(nr_task_bp_pinned, cpu)'s will
trigger spurious noderef related warnings from sparse. Changing it to
&per_cpu(nr_task_bp_pinned[0], cpu) will work around the problem but
deemed to ugly by the maintainer. Leave it alone until better
solution can be found.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <4B7B4B7A.9050902@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hw_breakpoint.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 5977b724f7c6..c70d27af03f9 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -66,14 +66,14 @@ register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | |||
66 | perf_overflow_handler_t triggered, | 66 | perf_overflow_handler_t triggered, |
67 | int cpu); | 67 | int cpu); |
68 | 68 | ||
69 | extern struct perf_event ** | 69 | extern struct perf_event * __percpu * |
70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
71 | perf_overflow_handler_t triggered); | 71 | perf_overflow_handler_t triggered); |
72 | 72 | ||
73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | 73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); |
74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | 74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); |
75 | extern void unregister_hw_breakpoint(struct perf_event *bp); | 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); |
76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | 76 | extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); |
77 | 77 | ||
78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); | 78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); |
79 | extern int dbg_release_bp_slot(struct perf_event *bp); | 79 | extern int dbg_release_bp_slot(struct perf_event *bp); |
@@ -100,7 +100,7 @@ static inline struct perf_event * | |||
100 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 100 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
101 | perf_overflow_handler_t triggered, | 101 | perf_overflow_handler_t triggered, |
102 | int cpu) { return NULL; } | 102 | int cpu) { return NULL; } |
103 | static inline struct perf_event ** | 103 | static inline struct perf_event * __percpu * |
104 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 104 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
105 | perf_overflow_handler_t triggered) { return NULL; } | 105 | perf_overflow_handler_t triggered) { return NULL; } |
106 | static inline int | 106 | static inline int |
@@ -109,7 +109,7 @@ static inline int | |||
109 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | 109 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } |
110 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } | 110 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } |
111 | static inline void | 111 | static inline void |
112 | unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } | 112 | unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { } |
113 | static inline int | 113 | static inline int |
114 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } | 114 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } |
115 | static inline void release_bp_slot(struct perf_event *bp) { } | 115 | static inline void release_bp_slot(struct perf_event *bp) { } |