From patchwork Sat May 28 17:36:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 6778 Return-path: Envelope-to: mchehab@pedra Delivery-date: Sat, 28 May 2011 16:20:49 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1QQP45-0000vk-D7 for mchehab@pedra; Sat, 28 May 2011 16:20:49 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Sat, 28 May 2011 16:20:49 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QQNU0-0005S1-Sc; Sat, 28 May 2011 17:39:29 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755442Ab1E1RhL (ORCPT + 1 other); Sat, 28 May 2011 13:37:11 -0400 Received: from mail.perches.com ([173.55.12.10]:2214 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755395Ab1E1RhJ (ORCPT ); Sat, 28 May 2011 13:37:09 -0400 Received: from Joe-Laptop.home (unknown [192.168.1.162]) by mail.perches.com (Postfix) with ESMTP id B597224371; Sat, 28 May 2011 10:36:58 -0700 (PDT) From: Joe Perches To: Jiri Kosina Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [TRIVIAL PATCH next 08/15] media: Convert vmalloc/memset to vzalloc Date: Sat, 28 May 2011 10:36:28 -0700 Message-Id: <9fdb8894cfb8778948dd9cf15711ec2ca68eb9b6.1306603968.git.joe@perches.com> X-Mailer: git-send-email 1.7.5.rc3.dirty In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Signed-off-by: Joe Perches --- drivers/media/video/videobuf2-dma-sg.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/video/videobuf2-dma-sg.c b/drivers/media/video/videobuf2-dma-sg.c index b2d9485..15d79a8 100644 --- a/drivers/media/video/videobuf2-dma-sg.c +++ b/drivers/media/video/videobuf2-dma-sg.c @@ -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 *), @@ -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 *),