diff options
author | Robin Murphy <robin.murphy@arm.com> | 2018-12-10 14:00:32 +0000 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-12-11 14:32:13 +0100 |
commit | 0cb0e25e421436a83ee39857923e4213b983e463 (patch) | |
tree | 3dbd76ab5d9d32e9a0ff32f9c3828cea2610f0bc /kernel | |
parent | a8a4c98fc9ac84ee9e068fbb16210d2ab8cfefe0 (diff) | |
download | linux-stable-0cb0e25e421436a83ee39857923e4213b983e463.tar.gz linux-stable-0cb0e25e421436a83ee39857923e4213b983e463.tar.bz2 linux-stable-0cb0e25e421436a83ee39857923e4213b983e463.zip |
dma/debug: Remove dma_debug_resize_entries()
With the only caller now gone, we can clean up this part of dma-debug's
exposed internals and make way to tweak the allocation behaviour.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Qian Cai <cai@lca.pw>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dma/debug.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 912c23f4c177..36a42874b05f 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -755,52 +755,6 @@ static void dma_entry_free(struct dma_debug_entry *entry) spin_unlock_irqrestore(&free_entries_lock, flags); } -int dma_debug_resize_entries(u32 num_entries) -{ - int i, delta, ret = 0; - unsigned long flags; - struct dma_debug_entry *entry; - LIST_HEAD(tmp); - - spin_lock_irqsave(&free_entries_lock, flags); - - if (nr_total_entries < num_entries) { - delta = num_entries - nr_total_entries; - - spin_unlock_irqrestore(&free_entries_lock, flags); - - for (i = 0; i < delta; i++) { - entry = kzalloc(sizeof(*entry), GFP_KERNEL); - if (!entry) - break; - - list_add_tail(&entry->list, &tmp); - } - - spin_lock_irqsave(&free_entries_lock, flags); - - list_splice(&tmp, &free_entries); - nr_total_entries += i; - num_free_entries += i; - } else { - delta = nr_total_entries - num_entries; - - for (i = 0; i < delta && !list_empty(&free_entries); i++) { - entry = __dma_entry_alloc(); - kfree(entry); - } - - nr_total_entries -= i; - } - - if (nr_total_entries != num_entries) - ret = 1; - - spin_unlock_irqrestore(&free_entries_lock, flags); - - return ret; -} - /* * DMA-API debugging init code * |