From patchwork Wed Aug 5 09:57:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6947591 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A52AC05AC for ; Wed, 5 Aug 2015 09:58:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C2D3203B0 for ; Wed, 5 Aug 2015 09:58:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1D4972038D for ; Wed, 5 Aug 2015 09:58:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 226BD265D2B; Wed, 5 Aug 2015 11:58:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A710D265D2C; Wed, 5 Aug 2015 11:57:50 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C3100265D63; Wed, 5 Aug 2015 11:57:48 +0200 (CEST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by alsa0.perex.cz (Postfix) with ESMTP id CC42B265CC5 for ; Wed, 5 Aug 2015 11:57:18 +0200 (CEST) Received: by pacgq8 with SMTP id gq8so31925154pac.3 for ; Wed, 05 Aug 2015 02:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=Di2bw+pmN5sf/M8Rg5xPFFhEyE3KyL0IgSwJrLTunHI=; b=W9rHO07uecJuAOwWGk4S+OnQszZpkir6WdtO4tOvvX7Il+8twOOsb9yOC3fRuAn3NH dqtyTvvAdeSgZ44U5xYwOu4XX4RQOXxTgw82AzeY/mBCzzZNmy0jJncM8di/DJUl2/CY OvAkZ/QmUcgB+HXiEJW8SgNLhFhMk2JK9bo43h4Sf1NKRJvG1Lyqd0ivD3sMiB5+8Qjv K280x5unVtqrRh2bUrBSWVK5qwJie/+Q4FdM5jCnu/FJr1EtP5mXAVTMW1n5yIliH13K 7jR4Sydu2553GEgVB8PnD1MKbOIit3Effd9YsLQGszhUfpNkRtd2/TKJogYZGnxQYOfb 5Yrw== X-Gm-Message-State: ALoCoQnvSWUvIcn/AxZRQ1KHSz0s87dyIu2P6SGngKh6DcOKZUGQyUhbIwUmRy0L6PSZqeB08D4Z X-Received: by 10.68.241.6 with SMTP id we6mr17789156pbc.127.1438768637461; Wed, 05 Aug 2015 02:57:17 -0700 (PDT) Received: from phoenix (59-115-241-1.dynamic.hinet.net. [59.115.241.1]) by smtp.gmail.com with ESMTPSA id nd6sm2232700pbc.65.2015.08.05.02.57.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 02:57:16 -0700 (PDT) Message-ID: <1438768632.27904.1.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Wed, 05 Aug 2015 17:57:12 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: alsa-devel@alsa-project.org, Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: topology: Use kcalloc instead of kzalloc for array allocation X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Also remove unnecessary memset. Signed-off-by: Axel Lin --- sound/soc/soc-topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 4dadb5e..a5eb48e 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1250,7 +1250,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create( struct snd_kcontrol_new *kc; int i, err; - kc = kzalloc(sizeof(*kc) * count, GFP_KERNEL); + kc = kcalloc(count, sizeof(*kc), GFP_KERNEL); if (!kc) return NULL; @@ -1273,7 +1273,6 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create( "ASoC: adding bytes kcontrol %s with access 0x%x\n", be->hdr.name, be->hdr.access); - memset(kc, 0, sizeof(*kc)); kc[i].name = be->hdr.name; kc[i].private_value = (long)sbe; kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER;