From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06520ECAAD8 for ; Fri, 16 Sep 2022 14:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbiIPOYV (ORCPT ); Fri, 16 Sep 2022 10:24:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232014AbiIPOYQ (ORCPT ); Fri, 16 Sep 2022 10:24:16 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D2CBB2DA6 for ; Fri, 16 Sep 2022 07:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663338253; x=1694874253; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=T2ApI7SubI2WKPmQQuZyAnZCYaKcuIBCP/Z0I7W79Zc=; b=P3JnOIouPYI4DZ5ih0Fr4Zg4q0ZGWy03N8GrA42Dge294Hr5sGKB0UOC PPe3MiKPUX21ZJXMBkEiaZl3ndNIkjnYJz/4ZC8qeqp0pY6/FOqI1nnC7 rshyDa7rxTt6UobLK6gyhB5C7LFV5aTgN8MnGJTPuqaGlmvAlEDNjei9C MelkxszvIAyXpYF7mZMbZsm/LwDzujopSK9UueZg7wR2g9sqgZbtY7DQ4 q4M/nz2t+kp/xniN8nyTR4ouTcuUJW0L8x8N6KgDu8Wk4TtRgIjmR9JZ/ lMBVCCRBjVjdtRMaZGt0pzRERzLubXQOPrBeIDIk9Dz/KLMy0W4LwYx8p Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="300362851" X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="300362851" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:24:13 -0700 X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="650888953" Received: from kchan21-mobl1.ger.corp.intel.com (HELO [10.252.61.56]) ([10.252.61.56]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:24:07 -0700 Message-ID: <3d95caba-7a4b-7f28-10a4-abdad75f999f@linux.intel.com> Date: Fri, 16 Sep 2022 10:24:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH linux-next] ASOC: SOF: use devm_kcalloc() instead of devm_kzalloc() Content-Language: en-US To: cgel.zte@gmail.com, broonie@kernel.org Cc: lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, perex@perex.cz, tiwai@suse.com, sound-open-firmware@alsa-project.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ye xingchen , Zeal Robot References: <20220916062511.153962-1-ye.xingchen@zte.com.cn> From: Pierre-Louis Bossart In-Reply-To: <20220916062511.153962-1-ye.xingchen@zte.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/16/22 08:25, cgel.zte@gmail.com wrote: > From: ye xingchen > > Use 2-factor multiplication argument form devm_kcalloc() instead > of devm_kzalloc(). > > Reported-by: Zeal Robot > Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart > --- > sound/soc/sof/nocodec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c > index 356497fe4f4c..3537805070ad 100644 > --- a/sound/soc/sof/nocodec.c > +++ b/sound/soc/sof/nocodec.c > @@ -32,7 +32,7 @@ static int sof_nocodec_bes_setup(struct device *dev, > > /* set up BE dai_links */ > for (i = 0; i < link_num; i++) { > - dlc = devm_kzalloc(dev, 3 * sizeof(*dlc), GFP_KERNEL); > + dlc = devm_kcalloc(dev, 3, sizeof(*dlc), GFP_KERNEL); > if (!dlc) > return -ENOMEM; > > @@ -78,7 +78,7 @@ static int sof_nocodec_setup(struct device *dev, > struct snd_soc_dai_link *links; > > /* create dummy BE dai_links */ > - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_dai_drivers, GFP_KERNEL); > + links = devm_kcalloc(dev, num_dai_drivers, sizeof(struct snd_soc_dai_link), GFP_KERNEL); > if (!links) > return -ENOMEM; > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9ABC1ECAAD8 for ; Fri, 16 Sep 2022 14:25:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B13711ACF; Fri, 16 Sep 2022 16:24:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B13711ACF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663338348; bh=T2ApI7SubI2WKPmQQuZyAnZCYaKcuIBCP/Z0I7W79Zc=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rUJO4wGriJjXHXroh2RLPcFZbHEmB2cm4aLVdqf/r7aRM/7X2nLVG+gi7ISJnrtIO GkbBvhKr6BNalIEycbp/0h/YyIy804DmHTpKMjVlnSlaGl6BpiYMy3yQ58f1jaVyO6 JTEnOFrkEot0z4KI5dlyKbae9sWZoJEbD14z1GjM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6FD75F8053B; Fri, 16 Sep 2022 16:24:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7B3A7F8053C; Fri, 16 Sep 2022 16:24:24 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C97F1F80535; Fri, 16 Sep 2022 16:24:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C97F1F80535 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iomNYEbh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663338259; x=1694874259; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=T2ApI7SubI2WKPmQQuZyAnZCYaKcuIBCP/Z0I7W79Zc=; b=iomNYEbhlEWjH0Ea+hEJDnahsD7n7UoR0TiQZnp+NKSzstrFZkH9IIeC 1Xv6UjxGKvuZRAAitGLZT1Lcv+NeP/rd4Wzcy9LGUFOK+wV7RhVv9Rt55 ngvcBs1fZF5nOnJuViqlvlTM9XNSv2YspSx9xtDOVrxFmFEOnscVsRGak RgGyM/mb4FKJQTw2oOftLkCzHIYzB2bR+JoskD2UxPVxrBf7i9fvUZmMV v0Lz5Fel0Nn3rB3b+v9WJKc/+If1dSL7GCjgfZGKwsSTMjMVY4kE2CwSM ePMQ49eAk8Ph+ky5cT4QRLoZwOxIQsKtP/0XFiY2JU9D7CFKioVxjBeFb A==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="282027865" X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="282027865" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:24:13 -0700 X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="650888953" Received: from kchan21-mobl1.ger.corp.intel.com (HELO [10.252.61.56]) ([10.252.61.56]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:24:07 -0700 Message-ID: <3d95caba-7a4b-7f28-10a4-abdad75f999f@linux.intel.com> Date: Fri, 16 Sep 2022 10:24:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH linux-next] ASOC: SOF: use devm_kcalloc() instead of devm_kzalloc() Content-Language: en-US To: cgel.zte@gmail.com, broonie@kernel.org References: <20220916062511.153962-1-ye.xingchen@zte.com.cn> From: Pierre-Louis Bossart In-Reply-To: <20220916062511.153962-1-ye.xingchen@zte.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com, yung-chuan.liao@linux.intel.com, Zeal Robot , tiwai@suse.com, peter.ujfalusi@linux.intel.com, lgirdwood@gmail.com, ranjani.sridharan@linux.intel.com, ye xingchen , daniel.baluta@nxp.com, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On 9/16/22 08:25, cgel.zte@gmail.com wrote: > From: ye xingchen > > Use 2-factor multiplication argument form devm_kcalloc() instead > of devm_kzalloc(). > > Reported-by: Zeal Robot > Signed-off-by: ye xingchen Acked-by: Pierre-Louis Bossart > --- > sound/soc/sof/nocodec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c > index 356497fe4f4c..3537805070ad 100644 > --- a/sound/soc/sof/nocodec.c > +++ b/sound/soc/sof/nocodec.c > @@ -32,7 +32,7 @@ static int sof_nocodec_bes_setup(struct device *dev, > > /* set up BE dai_links */ > for (i = 0; i < link_num; i++) { > - dlc = devm_kzalloc(dev, 3 * sizeof(*dlc), GFP_KERNEL); > + dlc = devm_kcalloc(dev, 3, sizeof(*dlc), GFP_KERNEL); > if (!dlc) > return -ENOMEM; > > @@ -78,7 +78,7 @@ static int sof_nocodec_setup(struct device *dev, > struct snd_soc_dai_link *links; > > /* create dummy BE dai_links */ > - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_dai_drivers, GFP_KERNEL); > + links = devm_kcalloc(dev, num_dai_drivers, sizeof(struct snd_soc_dai_link), GFP_KERNEL); > if (!links) > return -ENOMEM; >