Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.26-rc7 /mm/dmapool.c

Filename:/mm/dmapool.c
Lines Added:8
Lines Deleted:4
Also changed in: (Previous) 2.6.26-rc6  2.6.26-rc5  2.6.26-rc4  2.6.26-rc3  2.6.26-rc2  2.6.26-rc1 
(Following) 2.6.26-rc8  2.6.26-rc9  2.6.26 

Location
[  2.6.26-rc7
  [  mm
     o  dmapool.c

Patch

diff --git a/mm/dmapool.c b/mm/dmapool.c
index 34aaac4..b1f0885 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -37,6 +37,10 @@
 #include <linux/types.h>
 #include <linux/wait.h>
 
+#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB_DEBUG_ON)
+#define DMAPOOL_DEBUG 1
+#endif
+
 struct dma_pool {      /* the pool */
    struct list_head page_list;
    spinlock_t lock;
@@ -216,7 +220,7 @@ static struct dma_page *pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags)
    page->vaddr = dma_alloc_coherent(pool->dev, pool->allocation,
                 &page->dma, mem_flags);
    if (page->vaddr) {
-#ifdef   CONFIG_DEBUG_SLAB
+#ifdef   DMAPOOL_DEBUG
       memset(page->vaddr, POOL_POISON_FREED, pool->allocation);
 #endif
       pool_initialise_page(pool, page);
@@ -239,7 +243,7 @@ static void pool_free_page(struct dma_pool *pool, struct dma_page *page)
 {
    dma_addr_t dma = page->dma;
 
-#ifdef   CONFIG_DEBUG_SLAB
+#ifdef   DMAPOOL_DEBUG
    memset(page->vaddr, POOL_POISON_FREED, pool->allocation);
 #endif
    dma_free_coherent(pool->dev, pool->allocation, page->vaddr, dma);
@@ -336,7 +340,7 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
    page->offset = *(int *)(page->vaddr + offset);
    retval = offset + page->vaddr;
    *handle = offset + page->dma;
-#ifdef   CONFIG_DEBUG_SLAB
+#ifdef   DMAPOOL_DEBUG
    memset(retval, POOL_POISON_ALLOCATED, pool->size);
 #endif
  done:
@@ -391,7 +395,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
    }
 
    offset = vaddr - page->vaddr;
-#ifdef   CONFIG_DEBUG_SLAB
+#ifdef   DMAPOOL_DEBUG
    if ((dma - page->dma) != offset) {
       if (pool->dev)
          dev_err(pool->dev,


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.