Skip to content

Commit

Permalink
[media] media: Convert vmalloc/memset to vzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
JoePerches authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent fcc8e7d commit fabc6b8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/video/videobuf2-dma-sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size)
buf->sg_desc.size = size;
buf->sg_desc.num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;

buf->sg_desc.sglist = vmalloc(buf->sg_desc.num_pages *
buf->sg_desc.sglist = vzalloc(buf->sg_desc.num_pages *
sizeof(*buf->sg_desc.sglist));
if (!buf->sg_desc.sglist)
goto fail_sglist_alloc;
memset(buf->sg_desc.sglist, 0, buf->sg_desc.num_pages *
sizeof(*buf->sg_desc.sglist));
sg_init_table(buf->sg_desc.sglist, buf->sg_desc.num_pages);

buf->pages = kzalloc(buf->sg_desc.num_pages * sizeof(struct page *),
Expand Down Expand Up @@ -136,13 +134,11 @@ static void *vb2_dma_sg_get_userptr(void *alloc_ctx, unsigned long vaddr,
last = ((vaddr + size - 1) & PAGE_MASK) >> PAGE_SHIFT;
buf->sg_desc.num_pages = last - first + 1;

buf->sg_desc.sglist = vmalloc(
buf->sg_desc.sglist = vzalloc(
buf->sg_desc.num_pages * sizeof(*buf->sg_desc.sglist));
if (!buf->sg_desc.sglist)
goto userptr_fail_sglist_alloc;

memset(buf->sg_desc.sglist, 0,
buf->sg_desc.num_pages * sizeof(*buf->sg_desc.sglist));
sg_init_table(buf->sg_desc.sglist, buf->sg_desc.num_pages);

buf->pages = kzalloc(buf->sg_desc.num_pages * sizeof(struct page *),
Expand Down

0 comments on commit fabc6b8

Please sign in to comment.