Skip to content

Commit

Permalink
lib: fix sparse shadowed variable warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hharrison authored and torvalds committed Jan 6, 2009
1 parent 6034880 commit 40bc1f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/prio_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void *heap_insert(struct ptr_heap *heap, void *p)

if (heap->size < heap->max) {
/* Heap insertion */
int pos = heap->size++;
pos = heap->size++;
while (pos > 0 && heap->gt(p, ptrs[(pos-1)/2])) {
ptrs[pos] = ptrs[(pos-1)/2];
pos = (pos-1)/2;
Expand Down

0 comments on commit 40bc1f2

Please sign in to comment.