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 9B4DEC54EE9 for ; Fri, 16 Sep 2022 14:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230164AbiIPOYD (ORCPT ); Fri, 16 Sep 2022 10:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231448AbiIPOX5 (ORCPT ); Fri, 16 Sep 2022 10:23:57 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E562EB24B2 for ; Fri, 16 Sep 2022 07:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663338236; x=1694874236; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=quqz7w40+JN9mVdBdAp9nLJxD/EREdSo/n19syqzaqY=; b=elsJYRGg5iNtHA1encTaGtTnHNlu7pcB6PsXbq3oLGdK83tygUrNlU2z jAo/NPQGgj6Ylz8uBrniwv2mJm0vx9sXipBZPHJJ0AJ2hqjAK693hVE4m ldGs+QCZ2vpdqpvzl9MRDiGONhUwctRJ6njCjs8P1Yu4jaP0jAiwI6eB7 JVCr7g7ryP+aaVqfBuSZ2EoJ1o3LTKcv2azqd7ulE3ra2YhxXGq+IkVtZ ZVUcwcROQMhdp9BK7D2EPvggkwEXM1JCrq38hHDs5qXSaILM5wLCPdWEt 5SMDF0+OViIsc30Zecndqc9QDz5OIUY/OXGYtcKrcuM20NFW988E77KbJ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="299824145" X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="299824145" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:23:56 -0700 X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="650888893" 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:23:50 -0700 Message-ID: <0cc74fa6-a9f0-ac99-0cba-ca61929feeaf@linux.intel.com> Date: Fri, 16 Sep 2022 10:24:16 +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: Intel: sof_nau8825: use function devm_kcalloc() instead of devm_kzalloc() Content-Language: en-US To: cgel.zte@gmail.com, broonie@kernel.org Cc: cezary.rojewski@intel.com, liam.r.girdwood@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, perex@perex.cz, tiwai@suse.com, mac.chiang@intel.com, yong.zhi@intel.com, akihiko.odaki@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ye xingchen , Zeal Robot References: <20220916062320.153456-1-ye.xingchen@zte.com.cn> From: Pierre-Louis Bossart In-Reply-To: <20220916062320.153456-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:23, 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/intel/boards/sof_nau8825.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/sound/soc/intel/boards/sof_nau8825.c b/sound/soc/intel/boards/sof_nau8825.c > index 8d7e5ba9e516..5585c217f78d 100644 > --- a/sound/soc/intel/boards/sof_nau8825.c > +++ b/sound/soc/intel/boards/sof_nau8825.c > @@ -355,10 +355,10 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, > struct snd_soc_dai_link *links; > int i, id = 0; > > - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * > - sof_audio_card_nau8825.num_links, GFP_KERNEL); > - cpus = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component) * > - sof_audio_card_nau8825.num_links, GFP_KERNEL); > + links = devm_kcalloc(dev, sof_audio_card_nau8825.num_links, > + sizeof(struct snd_soc_dai_link), GFP_KERNEL); > + cpus = devm_kcalloc(dev, sof_audio_card_nau8825.num_links, > + sizeof(struct snd_soc_dai_link_component), GFP_KERNEL); > if (!links || !cpus) > goto devm_err; > > @@ -421,9 +421,10 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, > > /* HDMI */ > if (hdmi_num > 0) { > - idisp_components = devm_kzalloc(dev, > - sizeof(struct snd_soc_dai_link_component) * > - hdmi_num, GFP_KERNEL); > + idisp_components = devm_kcalloc(dev, > + hdmi_num, > + sizeof(struct snd_soc_dai_link_component), > + GFP_KERNEL); > if (!idisp_components) > goto devm_err; > } 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 EC6C2C6FA82 for ; Fri, 16 Sep 2022 14:25:19 +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 C805D1ABC; Fri, 16 Sep 2022 16:24:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C805D1ABC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663338317; bh=quqz7w40+JN9mVdBdAp9nLJxD/EREdSo/n19syqzaqY=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AC9fB+fqBfJk6WmOke9Jh2pOOhuNFthyjyi10gJw1IIyafUPzkoB2R+SX5IS/9fh/ Obl7OHUSx8uepLMY4VdsXvCFLCqAqxZc7LWfyjifxokrAKxOHrFGpvWho5UYnqBJOQ eiugwlgfGnJFytSjOqBOvTHmDEhwLasQreYv/t4c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 02A9DF800E5; Fri, 16 Sep 2022 16:24:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 31465F80528; Fri, 16 Sep 2022 16:24:06 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 3941CF8024C for ; Fri, 16 Sep 2022 16:23:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3941CF8024C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="g3IWklNR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663338240; x=1694874240; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=quqz7w40+JN9mVdBdAp9nLJxD/EREdSo/n19syqzaqY=; b=g3IWklNRLb+967kgYMySRlDjZFpml5aLoDIohl5pyE82gQ+PquGHwQwh tTziihR+8TAQCS0CTsDzzTQpbYR6tKRq4A0Lo0XaBBHGLTaFTyZupD9It ub6qJ5G6a+FkBGlyVTGtVtl4PpivsOyowskVVBkrpJATiCFhD9IQPLG6c L63scynCu8PFMzaWlArfGZVT75bqRE2uAll9zF6jy0qLr9lDrkJah+/Un QmL/3PYI+XmfA9tXucq5V+skQHKrYkB7q1QWYJ1xKIZei2eKJlSrN4Xf2 1H43uaPEF5R7rZkTvYidJ3M2g6NvhZN70My1JiawMC1J/G4MNcOwblzqL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="296589107" X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="296589107" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:23:56 -0700 X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="650888893" 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:23:50 -0700 Message-ID: <0cc74fa6-a9f0-ac99-0cba-ca61929feeaf@linux.intel.com> Date: Fri, 16 Sep 2022 10:24:16 +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: Intel: sof_nau8825: use function devm_kcalloc() instead of devm_kzalloc() Content-Language: en-US To: cgel.zte@gmail.com, broonie@kernel.org References: <20220916062320.153456-1-ye.xingchen@zte.com.cn> From: Pierre-Louis Bossart In-Reply-To: <20220916062320.153456-1-ye.xingchen@zte.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: cezary.rojewski@intel.com, kai.vehmanen@linux.intel.com, peter.ujfalusi@linux.intel.com, Zeal Robot , tiwai@suse.com, ranjani.sridharan@linux.intel.com, liam.r.girdwood@linux.intel.com, mac.chiang@intel.com, akihiko.odaki@gmail.com, ye xingchen , alsa-devel@alsa-project.org, yung-chuan.liao@linux.intel.com, linux-kernel@vger.kernel.org, yong.zhi@intel.com 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:23, 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/intel/boards/sof_nau8825.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/sound/soc/intel/boards/sof_nau8825.c b/sound/soc/intel/boards/sof_nau8825.c > index 8d7e5ba9e516..5585c217f78d 100644 > --- a/sound/soc/intel/boards/sof_nau8825.c > +++ b/sound/soc/intel/boards/sof_nau8825.c > @@ -355,10 +355,10 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, > struct snd_soc_dai_link *links; > int i, id = 0; > > - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * > - sof_audio_card_nau8825.num_links, GFP_KERNEL); > - cpus = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component) * > - sof_audio_card_nau8825.num_links, GFP_KERNEL); > + links = devm_kcalloc(dev, sof_audio_card_nau8825.num_links, > + sizeof(struct snd_soc_dai_link), GFP_KERNEL); > + cpus = devm_kcalloc(dev, sof_audio_card_nau8825.num_links, > + sizeof(struct snd_soc_dai_link_component), GFP_KERNEL); > if (!links || !cpus) > goto devm_err; > > @@ -421,9 +421,10 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, > > /* HDMI */ > if (hdmi_num > 0) { > - idisp_components = devm_kzalloc(dev, > - sizeof(struct snd_soc_dai_link_component) * > - hdmi_num, GFP_KERNEL); > + idisp_components = devm_kcalloc(dev, > + hdmi_num, > + sizeof(struct snd_soc_dai_link_component), > + GFP_KERNEL); > if (!idisp_components) > goto devm_err; > }