git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
junk
[linux-2.6.git]
/
drivers
/
base
/
dmapool.c
diff --git
a/drivers/base/dmapool.c
b/drivers/base/dmapool.c
index
bbbf066
..
e2f64f9
100644
(file)
--- a/
drivers/base/dmapool.c
+++ b/
drivers/base/dmapool.c
@@
-41,7
+41,7
@@
struct dma_page { /* cacheable header for 'allocation' bytes */
static DECLARE_MUTEX (pools_lock);
static ssize_t
static DECLARE_MUTEX (pools_lock);
static ssize_t
-show_pools (struct device *dev, char *buf)
+show_pools (struct device *dev,
struct device_attribute *attr,
char *buf)
{
unsigned temp;
unsigned size;
{
unsigned temp;
unsigned size;
@@
-110,7
+110,7
@@
dma_pool_create (const char *name, struct device *dev,
if (align == 0)
align = 1;
if (size == 0)
if (align == 0)
align = 1;
if (size == 0)
- return
0
;
+ return
NULL
;
else if (size < align)
size = align;
else if ((size % align) != 0) {
else if (size < align)
size = align;
else if ((size % align) != 0) {
@@
-125,7
+125,7
@@
dma_pool_create (const char *name, struct device *dev,
allocation = PAGE_SIZE;
// FIXME: round up for less fragmentation
} else if (allocation < size)
allocation = PAGE_SIZE;
// FIXME: round up for less fragmentation
} else if (allocation < size)
- return
0
;
+ return
NULL
;
if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL)))
return retval;
if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL)))
return retval;
@@
-156,7
+156,7
@@
dma_pool_create (const char *name, struct device *dev,
static struct dma_page *
static struct dma_page *
-pool_alloc_page (struct dma_pool *pool,
in
t mem_flags)
+pool_alloc_page (struct dma_pool *pool,
gfp_
t mem_flags)
{
struct dma_page *page;
int mapsize;
{
struct dma_page *page;
int mapsize;
@@
-167,7
+167,7
@@
pool_alloc_page (struct dma_pool *pool, int mem_flags)
page = (struct dma_page *) kmalloc (mapsize + sizeof *page, mem_flags);
if (!page)
page = (struct dma_page *) kmalloc (mapsize + sizeof *page, mem_flags);
if (!page)
- return
0
;
+ return
NULL
;
page->vaddr = dma_alloc_coherent (pool->dev,
pool->allocation,
&page->dma,
page->vaddr = dma_alloc_coherent (pool->dev,
pool->allocation,
&page->dma,
@@
-181,7
+181,7
@@
pool_alloc_page (struct dma_pool *pool, int mem_flags)
page->in_use = 0;
} else {
kfree (page);
page->in_use = 0;
} else {
kfree (page);
- page =
0
;
+ page =
NULL
;
}
return page;
}
}
return page;
}
@@
-262,7
+262,7
@@
dma_pool_destroy (struct dma_pool *pool)
* If such a memory block can't be allocated, null is returned.
*/
void *
* If such a memory block can't be allocated, null is returned.
*/
void *
-dma_pool_alloc (struct dma_pool *pool,
in
t mem_flags, dma_addr_t *handle)
+dma_pool_alloc (struct dma_pool *pool,
gfp_
t mem_flags, dma_addr_t *handle)
{
unsigned long flags;
struct dma_page *page;
{
unsigned long flags;
struct dma_page *page;
@@
-302,7
+302,7
@@
restart:
remove_wait_queue (&pool->waitq, &wait);
goto restart;
}
remove_wait_queue (&pool->waitq, &wait);
goto restart;
}
- retval =
0
;
+ retval =
NULL
;
goto done;
}
goto done;
}
@@
-334,7
+334,7
@@
pool_find_page (struct dma_pool *pool, dma_addr_t dma)
if (dma < (page->dma + pool->allocation))
goto done;
}
if (dma < (page->dma + pool->allocation))
goto done;
}
- page =
0
;
+ page =
NULL
;
done:
spin_unlock_irqrestore (&pool->lock, flags);
return page;
done:
spin_unlock_irqrestore (&pool->lock, flags);
return page;