aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-06-08 09:46:19 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-06-08 09:46:19 -0400
commitbe81c6ea23b8b471141734ef4bc005f5127aaf43 (patch)
treec43bebd9c640f1764e94d7a97f40d3c21c2bd4a4 /lib
parente7ed70eedccc78e79ce6da2155e9caf90aff4003 (diff)
dma-debug: disable/enable irqs only once in device_dma_allocations
There is no need to disable/enable irqs on each loop iteration. Just disable irqs for the whole time the loop runs. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/dma-debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 24c4a2c5d61..27b369da52c 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -649,15 +649,19 @@ static int device_dma_allocations(struct device *dev)
649 unsigned long flags; 649 unsigned long flags;
650 int count = 0, i; 650 int count = 0, i;
651 651
652 local_irq_save(flags);
653
652 for (i = 0; i < HASH_SIZE; ++i) { 654 for (i = 0; i < HASH_SIZE; ++i) {
653 spin_lock_irqsave(&dma_entry_hash[i].lock, flags); 655 spin_lock(&dma_entry_hash[i].lock);
654 list_for_each_entry(entry, &dma_entry_hash[i].list, list) { 656 list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
655 if (entry->dev == dev) 657 if (entry->dev == dev)
656 count += 1; 658 count += 1;
657 } 659 }
658 spin_unlock_irqrestore(&dma_entry_hash[i].lock, flags); 660 spin_unlock(&dma_entry_hash[i].lock);
659 } 661 }
660 662
663 local_irq_restore(flags);
664
661 return count; 665 return count;
662} 666}
663 667