Commit 40bc1f2dbc29ab88176a650e51f2246526105093

Authored by Harvey Harrison
Committed by Linus Torvalds
1 parent 60348802e9

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -31,7 +31,7 @@
31 31  
32 32 if (heap->size < heap->max) {
33 33 /* Heap insertion */
34   - int pos = heap->size++;
  34 + pos = heap->size++;
35 35 while (pos > 0 && heap->gt(p, ptrs[(pos-1)/2])) {
36 36 ptrs[pos] = ptrs[(pos-1)/2];
37 37 pos = (pos-1)/2;