Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Harvey Harrison and committed by
Linus Torvalds
40bc1f2d 60348802

+1 -1
+1 -1
lib/prio_heap.c
··· 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;