Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751230AbdLaM0O (ORCPT ); Sun, 31 Dec 2017 07:26:14 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:37255 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbdLaM0M (ORCPT ); Sun, 31 Dec 2017 07:26:12 -0500 X-Google-Smtp-Source: ACJfBovOd1Iq5BIwspgOnUXE3Udo5XHYfdx5SaEqR2K61vGCgBBrNAphEi7beiie8UUEyyRgKzCQog== From: Himanshu Jha To: b.zolnierkie@samsung.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] fbdev: auo_k190x: Use zeroing memory allocator than allocator/memset Date: Sun, 31 Dec 2017 17:55:57 +0530 Message-Id: <1514723157-5675-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1054 Lines: 34 Use vzalloc for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez Signed-off-by: Himanshu Jha --- drivers/video/fbdev/auo_k190x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c index 0d060383..b889401 100644 --- a/drivers/video/fbdev/auo_k190x.c +++ b/drivers/video/fbdev/auo_k190x.c @@ -1056,13 +1056,12 @@ int auok190x_common_probe(struct platform_device *pdev, /* videomemory handling */ videomemorysize = roundup((panel->w * panel->h) * 2, PAGE_SIZE); - videomemory = vmalloc(videomemorysize); + videomemory = vzalloc(videomemorysize); if (!videomemory) { ret = -ENOMEM; goto err_irq; } - memset(videomemory, 0, videomemorysize); info->screen_base = (char *)videomemory; info->fix.smem_len = videomemorysize; -- 2.7.4