All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] mm: Clean up local variables
@ 2006-01-04 17:01 Tobias Klauser
  2006-01-04 17:14 ` Jesper Juhl
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tobias Klauser @ 2006-01-04 17:01 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]

Clean up local variables with the same name as a variable in a larger
block. See http://linuxicc.sourceforge.net/Remark_1599.html for details.

Spotted by http://linuxicc.sourceforge.net/

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>

---

 mm/slab.c     |    1 -
 mm/swapfile.c |   12 ++++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff -urpN -X dontdiff linux-2.6.15/mm/slab.c linux-2.6.15~tk/mm/slab.c
--- linux-2.6.15/mm/slab.c	2006-01-03 14:41:57.000000000 +0100
+++ linux-2.6.15~tk/mm/slab.c	2006-01-04 15:52:41.000000000 +0100
@@ -921,7 +921,6 @@ static int __devinit cpuup_callback(stru
 		down(&cache_chain_sem);
 
 		list_for_each_entry(cachep, &cache_chain, next) {
-			struct array_cache *nc;
 			cpumask_t mask;
 
 			mask = node_to_cpumask(node);
diff -urpN -X dontdiff linux-2.6.15/mm/swapfile.c linux-2.6.15~tk/mm/swapfile.c
--- linux-2.6.15/mm/swapfile.c	2006-01-03 14:41:57.000000000 +0100
+++ linux-2.6.15~tk/mm/swapfile.c	2006-01-04 15:59:20.000000000 +0100
@@ -1473,7 +1473,7 @@ asmlinkage long sys_swapon(const char __
 			goto bad_swap;
 		if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES)
 			goto bad_swap;
-		
+
 		/* OK, set up the swap map and apply the bad block list */
 		if (!(p->swap_map = vmalloc(maxpages * sizeof(short)))) {
 			error = -ENOMEM;
@@ -1482,17 +1482,17 @@ asmlinkage long sys_swapon(const char __
 
 		error = 0;
 		memset(p->swap_map, 0, maxpages * sizeof(short));
-		for (i=0; i<swap_header->info.nr_badpages; i++) {
-			int page = swap_header->info.badpages[i];
-			if (page <= 0 || page >= swap_header->info.last_page)
+		for (i = 0; i < swap_header->info.nr_badpages; i++) {
+			int page_nr = swap_header->info.badpages[i];
+			if (page_nr <= 0 || page_nr >= swap_header->info.last_page)
 				error = -EINVAL;
 			else
-				p->swap_map[page] = SWAP_MAP_BAD;
+				p->swap_map[page_nr] = SWAP_MAP_BAD;
 		}
 		nr_good_pages = swap_header->info.last_page -
 				swap_header->info.nr_badpages -
 				1 /* header page */;
-		if (error) 
+		if (error)
 			goto bad_swap;
 	}
 

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-04 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-04 17:01 [KJ] [PATCH] mm: Clean up local variables Tobias Klauser
2006-01-04 17:14 ` Jesper Juhl
2006-01-04 17:18 ` Matthew Wilcox
2006-01-04 22:39 ` Tobias Klauser

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.