slub: fix shadowed variable sparse warnings

Introduce 'len' at outer level:
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>
Signed-off-by: Christoph Lameter <clameter@sgi.com>

authored by Harvey Harrison and committed by Christoph Lameter e374d483 9135f190

+18 -21
+18 -21
mm/slub.c
··· 3390 3390 static int list_locations(struct kmem_cache *s, char *buf, 3391 3391 enum track_item alloc) 3392 3392 { 3393 - int n = 0; 3393 + int len = 0; 3394 3394 unsigned long i; 3395 3395 struct loc_track t = { 0, 0, NULL }; 3396 3396 int node; ··· 3421 3421 for (i = 0; i < t.count; i++) { 3422 3422 struct location *l = &t.loc[i]; 3423 3423 3424 - if (n > PAGE_SIZE - 100) 3424 + if (len > PAGE_SIZE - 100) 3425 3425 break; 3426 - n += sprintf(buf + n, "%7ld ", l->count); 3426 + len += sprintf(buf + len, "%7ld ", l->count); 3427 3427 3428 3428 if (l->addr) 3429 - n += sprint_symbol(buf + n, (unsigned long)l->addr); 3429 + len += sprint_symbol(buf + len, (unsigned long)l->addr); 3430 3430 else 3431 - n += sprintf(buf + n, "<not-available>"); 3431 + len += sprintf(buf + len, "<not-available>"); 3432 3432 3433 3433 if (l->sum_time != l->min_time) { 3434 3434 unsigned long remainder; 3435 3435 3436 - n += sprintf(buf + n, " age=%ld/%ld/%ld", 3436 + len += sprintf(buf + len, " age=%ld/%ld/%ld", 3437 3437 l->min_time, 3438 3438 div_long_long_rem(l->sum_time, l->count, &remainder), 3439 3439 l->max_time); 3440 3440 } else 3441 - n += sprintf(buf + n, " age=%ld", 3441 + len += sprintf(buf + len, " age=%ld", 3442 3442 l->min_time); 3443 3443 3444 3444 if (l->min_pid != l->max_pid) 3445 - n += sprintf(buf + n, " pid=%ld-%ld", 3445 + len += sprintf(buf + len, " pid=%ld-%ld", 3446 3446 l->min_pid, l->max_pid); 3447 3447 else 3448 - n += sprintf(buf + n, " pid=%ld", 3448 + len += sprintf(buf + len, " pid=%ld", 3449 3449 l->min_pid); 3450 3450 3451 3451 if (num_online_cpus() > 1 && !cpus_empty(l->cpus) && 3452 - n < PAGE_SIZE - 60) { 3453 - n += sprintf(buf + n, " cpus="); 3454 - n += cpulist_scnprintf(buf + n, PAGE_SIZE - n - 50, 3452 + len < PAGE_SIZE - 60) { 3453 + len += sprintf(buf + len, " cpus="); 3454 + len += cpulist_scnprintf(buf + len, PAGE_SIZE - len - 50, 3455 3455 l->cpus); 3456 3456 } 3457 3457 3458 3458 if (num_online_nodes() > 1 && !nodes_empty(l->nodes) && 3459 - n < PAGE_SIZE - 60) { 3460 - n += sprintf(buf + n, " nodes="); 3461 - n += nodelist_scnprintf(buf + n, PAGE_SIZE - n - 50, 3459 + len < PAGE_SIZE - 60) { 3460 + len += sprintf(buf + len, " nodes="); 3461 + len += nodelist_scnprintf(buf + len, PAGE_SIZE - len - 50, 3462 3462 l->nodes); 3463 3463 } 3464 3464 3465 - n += sprintf(buf + n, "\n"); 3465 + len += sprintf(buf + len, "\n"); 3466 3466 } 3467 3467 3468 3468 free_loc_track(&t); 3469 3469 if (!t.count) 3470 - n += sprintf(buf, "No data\n"); 3471 - return n; 3470 + len += sprintf(buf, "No data\n"); 3471 + return len; 3472 3472 } 3473 3473 3474 3474 enum slab_stat_type { ··· 3498 3498 3499 3499 for_each_possible_cpu(cpu) { 3500 3500 struct page *page; 3501 - int node; 3502 3501 struct kmem_cache_cpu *c = get_cpu_slab(s, cpu); 3503 3502 3504 3503 if (!c) ··· 3509 3510 continue; 3510 3511 if (page) { 3511 3512 if (flags & SO_CPU) { 3512 - int x = 0; 3513 - 3514 3513 if (flags & SO_OBJECTS) 3515 3514 x = page->inuse; 3516 3515 else