Commit cd105df4 authored by Tobias Klauser's avatar Tobias Klauser Committed by Linus Torvalds

[PATCH] mm: clean up local variables

Clean up a local variable with the same name as a variable in a larger
block.  Also move a variable into the block where it's actually used.

Spotted by http://linuxicc.sourceforge.net/Signed-off-by: default avatarTobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 152194aa
...@@ -854,7 +854,6 @@ static int __devinit cpuup_callback(struct notifier_block *nfb, ...@@ -854,7 +854,6 @@ static int __devinit cpuup_callback(struct notifier_block *nfb,
struct kmem_list3 *l3 = NULL; struct kmem_list3 *l3 = NULL;
int node = cpu_to_node(cpu); int node = cpu_to_node(cpu);
int memsize = sizeof(struct kmem_list3); int memsize = sizeof(struct kmem_list3);
struct array_cache *nc = NULL;
switch (action) { switch (action) {
case CPU_UP_PREPARE: case CPU_UP_PREPARE:
...@@ -891,6 +890,8 @@ static int __devinit cpuup_callback(struct notifier_block *nfb, ...@@ -891,6 +890,8 @@ static int __devinit cpuup_callback(struct notifier_block *nfb,
/* Now we can go ahead with allocating the shared array's /* Now we can go ahead with allocating the shared array's
& array cache's */ & array cache's */
list_for_each_entry(cachep, &cache_chain, next) { list_for_each_entry(cachep, &cache_chain, next) {
struct array_cache *nc;
nc = alloc_arraycache(node, cachep->limit, nc = alloc_arraycache(node, cachep->limit,
cachep->batchcount); cachep->batchcount);
if (!nc) if (!nc)
......
...@@ -1502,12 +1502,12 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) ...@@ -1502,12 +1502,12 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
error = 0; error = 0;
memset(p->swap_map, 0, maxpages * sizeof(short)); memset(p->swap_map, 0, maxpages * sizeof(short));
for (i=0; i<swap_header->info.nr_badpages; i++) { for (i = 0; i < swap_header->info.nr_badpages; i++) {
int page = swap_header->info.badpages[i]; int page_nr = swap_header->info.badpages[i];
if (page <= 0 || page >= swap_header->info.last_page) if (page_nr <= 0 || page_nr >= swap_header->info.last_page)
error = -EINVAL; error = -EINVAL;
else else
p->swap_map[page] = SWAP_MAP_BAD; p->swap_map[page_nr] = SWAP_MAP_BAD;
} }
nr_good_pages = swap_header->info.last_page - nr_good_pages = swap_header->info.last_page -
swap_header->info.nr_badpages - swap_header->info.nr_badpages -
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment