aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2009-11-26 02:01:50 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-26 03:34:04 -0500
commit11e6635763bdc0e24b39a38876574660755acffc (patch)
tree9020eb9a4a527803e42b5770ca7a2e81b29fe425 /kernel
parent2c31b7958fd21df9fa04e5c36cda0f063ac70b27 (diff)
kernel/hw_breakpoint.c: Fix local/global shadowing
If the new percpu tree is combined with the perf events tree the following new warning triggers: kernel/hw_breakpoint.c: In function 'toggle_bp_task_slot': kernel/hw_breakpoint.c:151: warning: 'task_bp_pinned' is used uninitialized in this function Because it's not valid anymore to define a local variable and a percpu variable (even if it's file scope local) with the same name. Rename the local variable to resolve this. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: K.Prasad <prasad@linux.vnet.ibm.com> Cc: Tejun Heo <tj@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> LKML-Reference: <200911260701.nAQ71owx016356@imap1.linux-foundation.org> [ v2: added changelog ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/hw_breakpoint.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index dd3fb4a999d3..32e1018191be 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -121,7 +121,7 @@ static void toggle_bp_task_slot(struct task_struct *tsk, int cpu, bool enable)
121 int count = 0; 121 int count = 0;
122 struct perf_event *bp; 122 struct perf_event *bp;
123 struct perf_event_context *ctx = tsk->perf_event_ctxp; 123 struct perf_event_context *ctx = tsk->perf_event_ctxp;
124 unsigned int *task_bp_pinned; 124 unsigned int *tsk_pinned;
125 struct list_head *list; 125 struct list_head *list;
126 unsigned long flags; 126 unsigned long flags;
127 127
@@ -146,15 +146,15 @@ static void toggle_bp_task_slot(struct task_struct *tsk, int cpu, bool enable)
146 if (WARN_ONCE(count < 0, "No breakpoint counter found in the counter list")) 146 if (WARN_ONCE(count < 0, "No breakpoint counter found in the counter list"))
147 return; 147 return;
148 148
149 task_bp_pinned = per_cpu(task_bp_pinned, cpu); 149 tsk_pinned = per_cpu(task_bp_pinned, cpu);
150 if (enable) { 150 if (enable) {
151 task_bp_pinned[count]++; 151 tsk_pinned[count]++;
152 if (count > 0) 152 if (count > 0)
153 task_bp_pinned[count-1]--; 153 tsk_pinned[count-1]--;
154 } else { 154 } else {
155 task_bp_pinned[count]--; 155 tsk_pinned[count]--;
156 if (count > 0) 156 if (count > 0)
157 task_bp_pinned[count-1]++; 157 tsk_pinned[count-1]++;
158 } 158 }
159} 159}
160 160