cgroup: fix sparse warning of shadow symbol in cgroup.c
PATCH 1/1 cgroup: fix sparse warning of shadow symbol in cgroup.c
From: Paul Jackson <[email protected]>
Fix a code warning: symbol 'p' shadows an earlier one
This is a reincarnation of Harvey Harrison's patch:
cpuset: sparse warnings in cpuset.c
Independently, Cliff Wickman moved the affected code, from kernel/cpuset.c to kernel/cgroup.c, in his patch:
cpusets: update_cpumask revision
--- kernel/cgroup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
kernel/cgroup.c +5 -5
@@ -1897,14 +1897,14 @@ int cgroup_scan_tasks(struct cgroup_scanif (heap->size) {for (i =0 ; i < heap->size; i++) { -struct task_struct *p = heap->ptrs[i]; +struct task_struct *q = heap->ptrs[i];if (i ==0 ) { - latest_time = p->start_time; - latest_task = p; + latest_time = q->start_time; + latest_task = q; }/* Process the task per the caller's callback */ - scan->process_task (p, scan); -put_task_struct (p); + scan->process_task (q, scan); +put_task_struct (q); }/* * If we had to process any tasks at all, scan again
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373Quoted 4 lines · Paul Jackson
From: Paul Jackson <[email protected]>
Fix a code warning: symbol 'p' shadows an earlier one
Quoted 8 lines
This is a reincarnation of Harvey Harrison's patch:
cpuset: sparse warnings incpuset.cIndependently, Cliff Wickman moved the affected code, from
kernel/cpuset.ctokernel/cgroup.c, in his patch:
cpusets:update_cpumaskrevisionSigned-off-by Paul Jackson <[email protected]>
Quoted 35 lines
Cc Harvey Harrison <[email protected]>Cc Cliff Wickman <[email protected]>---
kernel/cgroup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)---
2.6.25-rc2-mm1.orig/kernel/cgroup.c2008-02-16 01:04:48.000000000 -0800
+++2.6.25-rc2-mm1/kernel/cgroup.c2008-02-23 04:19:44.006614677 -0800
@@ -1897,14 +1897,14 @@ int cgroup_scan_tasks(structcgroup_scanif (heap->size) { for (i = 0; i < heap->size; i++) { - struct task_struct *p = heap->ptrs[i]; + struct task_struct *q = heap->ptrs[i]; if (i == 0) { - latest_time = p->start_time; - latest_task = p; + latest_time = q->start_time; + latest_task = q; } /* Process the task per the caller's callback */ - scan->process_task(p, scan); - put_task_struct(p); + scan->process_task(q, scan); + put_task_struct(q); } /* * If we had to process any tasks at all, scan again--
I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <[email protected]> 1.650.933.1373