diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2009-01-06 17:40:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:11 -0500 |
commit | 40bc1f2dbc29ab88176a650e51f2246526105093 (patch) | |
tree | 0c9fd0f1a3430118214b06acfdb61bb80bb4fa7d /lib/prio_heap.c | |
parent | 60348802e9cb137ee86590c3e4c57c1ec2e8fc69 (diff) |
lib: fix sparse shadowed variable warning
pos is always set before being used, no need to declare a
second one inside the if() block.
lib/prio_heap.c:34:7: warning: symbol 'pos' shadows an earlier one
lib/prio_heap.c:30:6: originally declared here
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/prio_heap.c')
-rw-r--r-- | lib/prio_heap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/prio_heap.c b/lib/prio_heap.c index 471944a54e23..a7af6f85eca8 100644 --- a/lib/prio_heap.c +++ b/lib/prio_heap.c | |||
@@ -31,7 +31,7 @@ void *heap_insert(struct ptr_heap *heap, void *p) | |||
31 | 31 | ||
32 | if (heap->size < heap->max) { | 32 | if (heap->size < heap->max) { |
33 | /* Heap insertion */ | 33 | /* Heap insertion */ |
34 | int pos = heap->size++; | 34 | pos = heap->size++; |
35 | while (pos > 0 && heap->gt(p, ptrs[(pos-1)/2])) { | 35 | while (pos > 0 && heap->gt(p, ptrs[(pos-1)/2])) { |
36 | ptrs[pos] = ptrs[(pos-1)/2]; | 36 | ptrs[pos] = ptrs[(pos-1)/2]; |
37 | pos = (pos-1)/2; | 37 | pos = (pos-1)/2; |