mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Andrew Morton <akpm@linux-foundation.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	torvalds@linux-foundation.org, fweisbec@gmail.com,
	akpm@linux-foundation.org, tj@kernel.org, tglx@linutronix.de,
	mingo@elte.hu, prasad@linux.vnet.ibm.com
Subject: [tip:perf/core] kernel/hw_breakpoint.c: Fix local/global shadowing
Date: Thu, 26 Nov 2009 08:45:39 GMT	[thread overview]
Message-ID: <tip-11e6635763bdc0e24b39a38876574660755acffc@git.kernel.org> (raw)
In-Reply-To: <200911260701.nAQ71owx016356@imap1.linux-foundation.org>

Commit-ID:  11e6635763bdc0e24b39a38876574660755acffc
Gitweb:     http://git.kernel.org/tip/11e6635763bdc0e24b39a38876574660755acffc
Author:     Andrew Morton <akpm@linux-foundation.org>
AuthorDate: Wed, 25 Nov 2009 23:01:50 -0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Nov 2009 09:34:04 +0100

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>
---
 kernel/hw_breakpoint.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index dd3fb4a..32e1018 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)
 	int count = 0;
 	struct perf_event *bp;
 	struct perf_event_context *ctx = tsk->perf_event_ctxp;
-	unsigned int *task_bp_pinned;
+	unsigned int *tsk_pinned;
 	struct list_head *list;
 	unsigned long flags;
 
@@ -146,15 +146,15 @@ static void toggle_bp_task_slot(struct task_struct *tsk, int cpu, bool enable)
 	if (WARN_ONCE(count < 0, "No breakpoint counter found in the counter list"))
 		return;
 
-	task_bp_pinned = per_cpu(task_bp_pinned, cpu);
+	tsk_pinned = per_cpu(task_bp_pinned, cpu);
 	if (enable) {
-		task_bp_pinned[count]++;
+		tsk_pinned[count]++;
 		if (count > 0)
-			task_bp_pinned[count-1]--;
+			tsk_pinned[count-1]--;
 	} else {
-		task_bp_pinned[count]--;
+		tsk_pinned[count]--;
 		if (count > 0)
-			task_bp_pinned[count-1]++;
+			tsk_pinned[count-1]++;
 	}
 }
 

           reply	other threads:[~2009-11-26  8:46 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200911260701.nAQ71owx016356@imap1.linux-foundation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-11e6635763bdc0e24b39a38876574660755acffc@git.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome