From patchwork Fri May 23 10:31:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30738 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C1C5220AEA for ; Fri, 23 May 2014 10:42:00 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id z6sf18128537yhz.5 for ; Fri, 23 May 2014 03:42:00 -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=lLNTRh+sv3DI59PqtGxRXk1XUOu9L9IjO3RqjLXjQyY=; b=HjhxmTCn0Pfeoxfgi2Q0j7d5YYVza1LBYhKEo0ZCo+rZAIhv5t+uVE9jJ+so5k4DHo hNq1LWWAhAz6i8+6nfaPFD3GGMN4HqtFIrxNoL4QlU1M1aQoQvOf9p0ZopKd5yguwZck rk+VYiL4xQc1CBA0k6Bn2qXFLUEorjynByZdHyXkO9jY+bDncf4ExKeyluuD+buPf0qI B2jBQlw1EBFXqYVRq73pZRstaKezMvfyOcgDcoHlruwwhKhYWqJQNuNXV+IJF3opZhqx in1fbSshBy0m9rDm+bJw6zKRLxMph3HHae+V8u1Fp0nyEcw97IqT+12VFkH/+V/4oTwo xPVg== X-Gm-Message-State: ALoCoQkxTM8MucI7FzmdatQuEN4pMeyRucUU+x3zXiHq6vM8YuHwDUtHG1JA4+DNT/tpIYOVPULT X-Received: by 10.58.187.107 with SMTP id fr11mr1889653vec.34.1400841720344; Fri, 23 May 2014 03:42:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.143 with SMTP id s15ls1635707qga.33.gmail; Fri, 23 May 2014 03:42:00 -0700 (PDT) X-Received: by 10.52.14.130 with SMTP id p2mr1146820vdc.39.1400841720190; Fri, 23 May 2014 03:42:00 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id ek11si1393975vdd.25.2014.05.23.03.42.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so5995257vcb.29 for ; Fri, 23 May 2014 03:42:00 -0700 (PDT) X-Received: by 10.52.185.72 with SMTP id fa8mr2924330vdc.12.1400841720117; Fri, 23 May 2014 03:42:00 -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 ib8csp20407vcb; Fri, 23 May 2014 03:41:59 -0700 (PDT) X-Received: by 10.68.164.100 with SMTP id yp4mr4673554pbb.136.1400841719357; Fri, 23 May 2014 03:41:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qq2si3287112pbb.105.2014.05.23.03.41.58 for ; Fri, 23 May 2014 03:41:58 -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 S1752906AbaEWKce (ORCPT + 27 others); Fri, 23 May 2014 06:32:34 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:37490 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbaEWKcb (ORCPT ); Fri, 23 May 2014 06:32:31 -0400 Received: by mail-wg0-f42.google.com with SMTP id y10so4532076wgg.1 for ; Fri, 23 May 2014 03:32:30 -0700 (PDT) X-Received: by 10.180.77.68 with SMTP id q4mr2396035wiw.21.1400841150043; Fri, 23 May 2014 03:32:30 -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.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:29 -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 44/71] clocksource: sh_mtu2: Replace kmalloc + memset with kzalloc Date: Fri, 23 May 2014 12:31:24 +0200 Message-Id: <1400841111-6683-44-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.170 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 Tested-by: Wolfram Sang --- drivers/clocksource/sh_mtu2.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index 61827c6..94a5342 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -241,8 +241,6 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_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->rating = rating; @@ -279,7 +277,6 @@ static int sh_mtu2_setup_channel(struct sh_mtu2_channel *ch, { struct sh_timer_config *cfg = mtu->pdev->dev.platform_data; - memset(ch, 0, sizeof(*ch)); ch->mtu = mtu; ch->index = cfg->timer_bit; @@ -302,7 +299,6 @@ static int sh_mtu2_setup(struct sh_mtu2_device *mtu, int ret; ret = -ENXIO; - memset(mtu, 0, sizeof(*mtu)); mtu->pdev = pdev; if (!cfg) { @@ -373,7 +369,7 @@ static int sh_mtu2_probe(struct platform_device *pdev) goto out; } - mtu = kmalloc(sizeof(*mtu), GFP_KERNEL); + mtu = kzalloc(sizeof(*mtu), GFP_KERNEL); if (mtu == NULL) { dev_err(&pdev->dev, "failed to allocate driver data\n"); return -ENOMEM;