From: Harvey Harrison Date: Tue, 6 Jan 2009 22:40:49 +0000 (-0800) Subject: lib: fix sparse shadowed variable warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40bc1f2dbc29ab88176a650e51f2246526105093;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) 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;