projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] memory hotplug: fix compile error for i386 with NUMA config
[powerpc.git]
/
sound
/
core
/
sgbuf.c
diff --git
a/sound/core/sgbuf.c
b/sound/core/sgbuf.c
index
6e4d4ab
..
cefd228
100644
(file)
--- a/
sound/core/sgbuf.c
+++ b/
sound/core/sgbuf.c
@@
-27,7
+27,7
@@
/* table entries are align to 32 */
#define SGBUF_TBL_ALIGN 32
/* table entries are align to 32 */
#define SGBUF_TBL_ALIGN 32
-#define sgbuf_align_table(tbl)
((((tbl) + SGBUF_TBL_ALIGN - 1) / SGBUF_TBL_ALIGN) *
SGBUF_TBL_ALIGN)
+#define sgbuf_align_table(tbl)
ALIGN((tbl),
SGBUF_TBL_ALIGN)
int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab)
{
int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab)
{
@@
-68,21
+68,18
@@
void *snd_malloc_sgbuf_pages(struct device *device,
dmab->area = NULL;
dmab->addr = 0;
dmab->area = NULL;
dmab->addr = 0;
- dmab->private_data = sgbuf = k
m
alloc(sizeof(*sgbuf), GFP_KERNEL);
+ dmab->private_data = sgbuf = k
z
alloc(sizeof(*sgbuf), GFP_KERNEL);
if (! sgbuf)
return NULL;
if (! sgbuf)
return NULL;
- memset(sgbuf, 0, sizeof(*sgbuf));
sgbuf->dev = device;
pages = snd_sgbuf_aligned_pages(size);
sgbuf->tblsize = sgbuf_align_table(pages);
sgbuf->dev = device;
pages = snd_sgbuf_aligned_pages(size);
sgbuf->tblsize = sgbuf_align_table(pages);
- sgbuf->table = k
malloc(sizeof(*sgbuf->table) * sgbuf->tblsize
, GFP_KERNEL);
+ sgbuf->table = k
calloc(sgbuf->tblsize, sizeof(*sgbuf->table)
, GFP_KERNEL);
if (! sgbuf->table)
goto _failed;
if (! sgbuf->table)
goto _failed;
- memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize);
- sgbuf->page_table = kmalloc(sizeof(*sgbuf->page_table) * sgbuf->tblsize, GFP_KERNEL);
+ sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL);
if (! sgbuf->page_table)
goto _failed;
if (! sgbuf->page_table)
goto _failed;
- memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize);
/* allocate each page */
for (i = 0; i < pages; i++) {
/* allocate each page */
for (i = 0; i < pages; i++) {