* [PATCH 1/3] lib: fix sparse shadowed variable warning
@ 2008-11-10 5:36 Harvey Harrison
0 siblings, 0 replies; only message in thread
From: Harvey Harrison @ 2008-11-10 5:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: LKML
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>
---
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 471944a..a7af6f8 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;
--
1.6.0.3.866.gc189b
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-10 5:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 5:36 [PATCH 1/3] lib: fix sparse shadowed variable warning Harvey Harrison
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox