All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] slub: fix shadowed variable sparse warnings
Date: Wed, 30 Jan 2008 20:23:25 -0800	[thread overview]
Message-ID: <1201753405.23523.8.camel@brick> (raw)

Use *nd for *n:
mm/slub.c:3406:26: warning: symbol 'n' shadows an earlier one
mm/slub.c:3393:6: originally declared here

No need to declare new node:
mm/slub.c:3501:7: warning: symbol 'node' shadows an earlier one
mm/slub.c:3491:6: originally declared here

No need to declare new x:
mm/slub.c:3513:9: warning: symbol 'x' shadows an earlier one
mm/slub.c:3492:6: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 mm/slub.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 5cc4b7d..f9a20bf 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3403,19 +3403,19 @@ static int list_locations(struct kmem_cache *s, char *buf,
 	flush_all(s);
 
 	for_each_node_state(node, N_NORMAL_MEMORY) {
-		struct kmem_cache_node *n = get_node(s, node);
+		struct kmem_cache_node *nd = get_node(s, node);
 		unsigned long flags;
 		struct page *page;
 
-		if (!atomic_long_read(&n->nr_slabs))
+		if (!atomic_long_read(&nd->nr_slabs))
 			continue;
 
-		spin_lock_irqsave(&n->list_lock, flags);
-		list_for_each_entry(page, &n->partial, lru)
+		spin_lock_irqsave(&nd->list_lock, flags);
+		list_for_each_entry(page, &nd->partial, lru)
 			process_slab(&t, s, page, alloc);
-		list_for_each_entry(page, &n->full, lru)
+		list_for_each_entry(page, &nd->full, lru)
 			process_slab(&t, s, page, alloc);
-		spin_unlock_irqrestore(&n->list_lock, flags);
+		spin_unlock_irqrestore(&nd->list_lock, flags);
 	}
 
 	for (i = 0; i < t.count; i++) {
@@ -3498,7 +3498,6 @@ static unsigned long slab_objects(struct kmem_cache *s,
 
 	for_each_possible_cpu(cpu) {
 		struct page *page;
-		int node;
 		struct kmem_cache_cpu *c = get_cpu_slab(s, cpu);
 
 		if (!c)
@@ -3510,8 +3509,6 @@ static unsigned long slab_objects(struct kmem_cache *s,
 			continue;
 		if (page) {
 			if (flags & SO_CPU) {
-				int x = 0;
-
 				if (flags & SO_OBJECTS)
 					x = page->inuse;
 				else
-- 
1.5.4.rc4.1142.gf5a97




             reply	other threads:[~2008-01-31  4:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31  4:23 Harvey Harrison [this message]
2008-01-31  4:28 ` [PATCH] slub: fix shadowed variable sparse warnings Christoph Lameter
2008-01-31  4:40   ` [PATCHv2] " Harvey Harrison

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=1201753405.23523.8.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.