From patchwork Fri May 23 10:30:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30688 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 14B2420369 for ; Fri, 23 May 2014 10:32:39 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf21260570obc.8 for ; Fri, 23 May 2014 03:32:38 -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=rN9/xZDZaxsBGUxJwgJgQ47HY+p/mxqMEN63Kg/z4Hs=; b=FbdxP6QVunzPDv/Eh29kxvy2hz8FU6WsEAcAnvCmaoKQfou0hwjak4KbpaHmqu2LgT tnUwM2UQjN66Lo9cFVUlA8KUjpYofZW4nThCdmh+9ca2eYdODNKdGVcNdo0zpsoFJnVF Suhp8WXgQAa5npeiKcU0AlFXF7U2u/TYlDPdk+ZbiufcCSaVrVa1gSxog4Y6n2n7aoah uCQDeUTzM1o60l3bWFdE45IQeFC01dqtw4lvoJocfw7od5TGOOO/xTPTq/w519Hr2bdA TTUhYKtjXZj5gNFIwwG5avE82l5jABdmdC5SFucl0O/CIQt4rjrEEyc/Y9EDjKxG5nef 9AdA== X-Gm-Message-State: ALoCoQksZC72Mh8+VrcAIObOZB9NXN59MJ0Y7MiVhJAAiNnNnxSTxmDMeA7jVA2XFyQylQccPMzB X-Received: by 10.43.117.71 with SMTP id fl7mr1615048icc.24.1400841158677; Fri, 23 May 2014 03:32:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.115 with SMTP id e106ls1696512qgd.65.gmail; Fri, 23 May 2014 03:32:38 -0700 (PDT) X-Received: by 10.52.182.227 with SMTP id eh3mr890919vdc.40.1400841158474; Fri, 23 May 2014 03:32:38 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id pd4si1387357vec.35.2014.05.23.03.32.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so6017893vcb.32 for ; Fri, 23 May 2014 03:32:38 -0700 (PDT) X-Received: by 10.58.169.97 with SMTP id ad1mr37173vec.45.1400841158406; Fri, 23 May 2014 03:32:38 -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 ib8csp19786vcb; Fri, 23 May 2014 03:32:38 -0700 (PDT) X-Received: by 10.66.197.201 with SMTP id iw9mr4391494pac.151.1400841157444; Fri, 23 May 2014 03:32:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg4si3275525pbb.67.2014.05.23.03.32.36 for ; Fri, 23 May 2014 03:32:36 -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 S1752533AbaEWKbw (ORCPT + 27 others); Fri, 23 May 2014 06:31:52 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:59913 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbaEWKbs (ORCPT ); Fri, 23 May 2014 06:31:48 -0400 Received: by mail-wg0-f51.google.com with SMTP id x13so4522285wgg.34 for ; Fri, 23 May 2014 03:31:47 -0700 (PDT) X-Received: by 10.180.11.196 with SMTP id s4mr2433186wib.34.1400841107322; Fri, 23 May 2014 03:31:47 -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.31.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:31:46 -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 09/71] clocksource: sh_cmt: Replace kmalloc + memset with kzalloc Date: Fri, 23 May 2014 12:30:49 +0200 Message-Id: <1400841111-6683-9-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.173 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_cmt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 6b65621..0779bf1 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -672,8 +672,6 @@ static void sh_cmt_register_clockevent(struct sh_cmt_channel *ch, { struct clock_event_device *ced = &ch->ced; - memset(ced, 0, sizeof(*ced)); - ced->name = name; ced->features = CLOCK_EVT_FEAT_PERIODIC; ced->features |= CLOCK_EVT_FEAT_ONESHOT; @@ -709,7 +707,6 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index, int irq; int ret; - memset(ch, 0, sizeof(*ch)); ch->cmt = cmt; ch->base = cmt->mapbase_ch; ch->index = index; @@ -758,7 +755,6 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) int ret; ret = -ENXIO; - memset(cmt, 0, sizeof(*cmt)); cmt->pdev = pdev; if (!cfg) { @@ -861,7 +857,7 @@ static int sh_cmt_probe(struct platform_device *pdev) goto out; } - cmt = kmalloc(sizeof(*cmt), GFP_KERNEL); + cmt = kzalloc(sizeof(*cmt), GFP_KERNEL); if (cmt == NULL) { dev_err(&pdev->dev, "failed to allocate driver data\n"); return -ENOMEM;