diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-01-08 04:00:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:12:43 -0500 |
commit | cd105df4590c89837a1c300843238148cfef9b5f (patch) | |
tree | bea54d8f24ad97d4af5fda6baac5711fa524af0e /mm/swapfile.c | |
parent | 152194aaa6266d71dfee57882a23def339ef17a4 (diff) |
[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: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 6da4b28b896b..80f948a2028b 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1493,7 +1493,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | |||
1493 | goto bad_swap; | 1493 | goto bad_swap; |
1494 | if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) | 1494 | if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) |
1495 | goto bad_swap; | 1495 | goto bad_swap; |
1496 | 1496 | ||
1497 | /* OK, set up the swap map and apply the bad block list */ | 1497 | /* OK, set up the swap map and apply the bad block list */ |
1498 | if (!(p->swap_map = vmalloc(maxpages * sizeof(short)))) { | 1498 | if (!(p->swap_map = vmalloc(maxpages * sizeof(short)))) { |
1499 | error = -ENOMEM; | 1499 | error = -ENOMEM; |
@@ -1502,17 +1502,17 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | |||
1502 | 1502 | ||
1503 | error = 0; | 1503 | error = 0; |
1504 | memset(p->swap_map, 0, maxpages * sizeof(short)); | 1504 | memset(p->swap_map, 0, maxpages * sizeof(short)); |
1505 | for (i=0; i<swap_header->info.nr_badpages; i++) { | 1505 | for (i = 0; i < swap_header->info.nr_badpages; i++) { |
1506 | int page = swap_header->info.badpages[i]; | 1506 | int page_nr = swap_header->info.badpages[i]; |
1507 | if (page <= 0 || page >= swap_header->info.last_page) | 1507 | if (page_nr <= 0 || page_nr >= swap_header->info.last_page) |
1508 | error = -EINVAL; | 1508 | error = -EINVAL; |
1509 | else | 1509 | else |
1510 | p->swap_map[page] = SWAP_MAP_BAD; | 1510 | p->swap_map[page_nr] = SWAP_MAP_BAD; |
1511 | } | 1511 | } |
1512 | nr_good_pages = swap_header->info.last_page - | 1512 | nr_good_pages = swap_header->info.last_page - |
1513 | swap_header->info.nr_badpages - | 1513 | swap_header->info.nr_badpages - |
1514 | 1 /* header page */; | 1514 | 1 /* header page */; |
1515 | if (error) | 1515 | if (error) |
1516 | goto bad_swap; | 1516 | goto bad_swap; |
1517 | } | 1517 | } |
1518 | 1518 | ||