From patchwork Fri May 23 10:31:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30756 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DD8F02066E for ; Fri, 23 May 2014 10:47:09 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id c1sf1705963igq.2 for ; Fri, 23 May 2014 03:47:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=MT96RLhe/ZgHSqT4LhJN1zWzJK8b0HGlvY4NAdgt2Fg=; b=jYBu/Hp1nwvKsbGr2AQKzlQI9VNhrIvbGNFfiWp9eHZTTTJXs+POyNVvP1sucXiPLQ jf6tPlS1/tnNDdtp70z43QF3XGAHvuu/dCO1ZyWonBJ2Jawa46ksmk+GuJXzwODzkceX TuFSDa6xhrvxhy3h+S+YpOjcJ7cRy09gX9QYQ49dDHwAliUyxUu8ZhrrmhgPdn2PwmlV 5jJicBq6c+I7H05jn/SioGxos1yrlKn2MjbzX+NPk4tBT5pLCtFsOTre3Mwt3FraJkHU TA1qHKacIxkI02GXCmlwFirIkEF6yNuZOtzLVKo+04dGTl5RvwKjL1pv73pq3nhb87WT Hu9A== X-Gm-Message-State: ALoCoQn8bVk2zWbGmsJZX9gI9gCvuhrrykGjPLZh866+6z1DXwPOuG2o/KwoVauNI9BQ76eqGJF4 X-Received: by 10.182.86.5 with SMTP id l5mr1841750obz.32.1400842029344; Fri, 23 May 2014 03:47:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.115 with SMTP id e106ls1699377qgd.65.gmail; Fri, 23 May 2014 03:47:09 -0700 (PDT) X-Received: by 10.52.164.237 with SMTP id yt13mr2955463vdb.18.1400842029230; Fri, 23 May 2014 03:47:09 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id yh7si1380921vdc.93.2014.05.23.03.47.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:47:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lc6so6019702vcb.30 for ; Fri, 23 May 2014 03:47:09 -0700 (PDT) X-Received: by 10.52.96.8 with SMTP id do8mr1795160vdb.4.1400842029162; Fri, 23 May 2014 03:47:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp20674vcb; Fri, 23 May 2014 03:47:08 -0700 (PDT) X-Received: by 10.66.231.139 with SMTP id tg11mr4680380pac.87.1400842028420; Fri, 23 May 2014 03:47:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cx2si3291503pbc.138.2014.05.23.03.47.07 for ; Fri, 23 May 2014 03:47:07 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753770AbaEWKrA (ORCPT + 27 others); Fri, 23 May 2014 06:47:00 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:62813 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbaEWKcL (ORCPT ); Fri, 23 May 2014 06:32:11 -0400 Received: by mail-wi0-f180.google.com with SMTP id hi2so623388wib.7 for ; Fri, 23 May 2014 03:32:10 -0700 (PDT) X-Received: by 10.194.84.101 with SMTP id x5mr3379751wjy.52.1400841130597; Fri, 23 May 2014 03:32:10 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-404-187.w82-125.abo.wanadoo.fr. [82.125.3.187]) by mx.google.com with ESMTPSA id s9sm2200908wix.13.2014.05.23.03.32.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:10 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 28/71] clocksource: sh_tmu: Replace kmalloc + memset with kzalloc Date: Fri, 23 May 2014 12:31:08 +0200 Message-Id: <1400841111-6683-28-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> References: <537F214C.8000700@linaro.org> <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Laurent Pinchart One kzalloc a day keeps the bugs away. Signed-off-by: Laurent Pinchart --- drivers/clocksource/sh_tmu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index e304304..26a9f7d 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -397,8 +397,6 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch, struct clock_event_device *ced = &ch->ced; int ret; - memset(ced, 0, sizeof(*ced)); - ced->name = name; ced->features = CLOCK_EVT_FEAT_PERIODIC; ced->features |= CLOCK_EVT_FEAT_ONESHOT; @@ -441,7 +439,6 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, { struct sh_timer_config *cfg = tmu->pdev->dev.platform_data; - memset(ch, 0, sizeof(*ch)); ch->tmu = tmu; /* @@ -475,7 +472,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) int ret; ret = -ENXIO; - memset(tmu, 0, sizeof(*tmu)); tmu->pdev = pdev; if (!cfg) { @@ -547,7 +543,7 @@ static int sh_tmu_probe(struct platform_device *pdev) goto out; } - tmu = kmalloc(sizeof(*tmu), GFP_KERNEL); + tmu = kzalloc(sizeof(*tmu), GFP_KERNEL); if (tmu == NULL) { dev_err(&pdev->dev, "failed to allocate driver data\n"); return -ENOMEM;