diff options
author | Luis R. Rodriguez <lrodriguez@Atheros.com> | 2009-09-08 12:32:34 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-09-08 12:34:06 -0400 |
commit | 0580a1819c584eb8b98f8701157667037e11153a (patch) | |
tree | f55002557bbeb45c1eadcbe53f222cf618002732 | |
parent | a1084c8779f5efa771c6896a0a4184900b4ab736 (diff) |
kmemleak: fix sparse warning over overshadowed flags
A secondary irq_save is not required as a locking before it was
already disabling irqs.
This fixes this sparse warning:
mm/kmemleak.c:512:31: warning: symbol 'flags' shadows an earlier one
mm/kmemleak.c:448:23: originally declared here
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | mm/kmemleak.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index b18d9ca578b9..ffd162abbe5e 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -555,6 +555,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, | |||
555 | object->tree_node.last = ptr + size - 1; | 555 | object->tree_node.last = ptr + size - 1; |
556 | 556 | ||
557 | write_lock_irqsave(&kmemleak_lock, flags); | 557 | write_lock_irqsave(&kmemleak_lock, flags); |
558 | |||
558 | min_addr = min(min_addr, ptr); | 559 | min_addr = min(min_addr, ptr); |
559 | max_addr = max(max_addr, ptr + size); | 560 | max_addr = max(max_addr, ptr + size); |
560 | node = prio_tree_insert(&object_tree_root, &object->tree_node); | 561 | node = prio_tree_insert(&object_tree_root, &object->tree_node); |
@@ -565,14 +566,12 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, | |||
565 | * random memory blocks. | 566 | * random memory blocks. |
566 | */ | 567 | */ |
567 | if (node != &object->tree_node) { | 568 | if (node != &object->tree_node) { |
568 | unsigned long flags; | ||
569 | |||
570 | kmemleak_stop("Cannot insert 0x%lx into the object search tree " | 569 | kmemleak_stop("Cannot insert 0x%lx into the object search tree " |
571 | "(already existing)\n", ptr); | 570 | "(already existing)\n", ptr); |
572 | object = lookup_object(ptr, 1); | 571 | object = lookup_object(ptr, 1); |
573 | spin_lock_irqsave(&object->lock, flags); | 572 | spin_lock(&object->lock); |
574 | dump_object_info(object); | 573 | dump_object_info(object); |
575 | spin_unlock_irqrestore(&object->lock, flags); | 574 | spin_unlock(&object->lock); |
576 | 575 | ||
577 | goto out; | 576 | goto out; |
578 | } | 577 | } |