From patchwork Sun Dec 31 12:25:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 10138113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3B9286020A for ; Sun, 31 Dec 2017 12:26:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21B0528622 for ; Sun, 31 Dec 2017 12:26:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 164B6286CC; Sun, 31 Dec 2017 12:26:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7A7028622 for ; Sun, 31 Dec 2017 12:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751190AbdLaM0N (ORCPT ); Sun, 31 Dec 2017 07:26:13 -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 Received: by mail-pl0-f66.google.com with SMTP id s3so25622116plp.4; Sun, 31 Dec 2017 04:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=8QBWIlNZhm5x/OPejYYKFVVccuWs+QdE16DcqPKnMXc=; b=WXtfLPWU21lX8QwEuDLMJfYZvgFBvPyYfDh7EQ9l+nNaanki7CIpaAxAVBKutehC1r RB7YHHQY8UrJwZseQYbo3Ww7UaRoOu5YISdEdleHrltQVMxGhQP0p+LbMEiKkp3sX9hN Hb3vRFghLDtRyfpzJ9EnELfWtyNu41N2UjyfR9DQDx15FaWEfpjEUjvaLVJ+uf46dj7b l3C0fOoOYDXQRG7hYxIj9TiFHAB+si7PZ9NetJFSBh9TECKGewwYgc8xtFX697arg1qc Ls7VdoRSHbK52O9ZzHyZBUrm+3+31xFnukHZQALJOlO8arPzbF6NhG2M/NyvA/G69+ne u+fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8QBWIlNZhm5x/OPejYYKFVVccuWs+QdE16DcqPKnMXc=; b=Jmf38t+9YHOQsm5k9PAu6YE0J7z5t/7os5atS/oj0sTy874QkWvr2VKo8qHRyJjbrX YMxEprw26uDpfZhjkbhmXA+dxlly7iQvl2ZajkftpfOUtVtNMKZUfWOWryTaRb1YHedQ xUsUGkfdzW1PeaRWp6vGRtRnrhkEyen+5AddbIrkqR9GsZdUNHQf+mzHeh3NWb29RVmK Ouhh4oPOmYkXl7e61+eLFPkH54i5+yfH5aZ0Il40XD0NqGD77/BuPfC4vyUjmz9XlaPs gVKlsCVyJgMEm7laFladTtGCqAcI0tFkMrq5aW+84zWSO+eEJhchvutIp9Dmh4abU3cZ OiUQ== X-Gm-Message-State: AKGB3mLCyLnLCl9dSXsTP8e9s/NToCMZ3JwDBj9VACfmHbN0hJTmJY5g xCxGS1llCT1+PLQuAUBBCPQ= X-Google-Smtp-Source: ACJfBovOd1Iq5BIwspgOnUXE3Udo5XHYfdx5SaEqR2K61vGCgBBrNAphEi7beiie8UUEyyRgKzCQog== X-Received: by 10.159.255.71 with SMTP id u7mr41331714pls.376.1514723172176; Sun, 31 Dec 2017 04:26:12 -0800 (PST) Received: from localhost.localdomain ([103.46.193.14]) by smtp.gmail.com with ESMTPSA id x22sm84049864pfa.169.2017.12.31.04.26.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 31 Dec 2017 04:26:11 -0800 (PST) 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-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;