All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
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 <ye.xingchen@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] ASoC: Intel: sof_nau8825: use function devm_kcalloc() instead of devm_kzalloc()
Date: Fri, 16 Sep 2022 10:24:16 +0200	[thread overview]
Message-ID: <0cc74fa6-a9f0-ac99-0cba-ca61929feeaf@linux.intel.com> (raw)
In-Reply-To: <20220916062320.153456-1-ye.xingchen@zte.com.cn>



On 9/16/22 08:23, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Use 2-factor multiplication argument form devm_kcalloc() instead
> of devm_kzalloc().
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>


> ---
>  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;
>  	}

WARNING: multiple messages have this Message-ID (diff)
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: cgel.zte@gmail.com, broonie@kernel.org
Cc: cezary.rojewski@intel.com, kai.vehmanen@linux.intel.com,
	peter.ujfalusi@linux.intel.com, Zeal Robot <zealci@zte.com.cn>,
	tiwai@suse.com, ranjani.sridharan@linux.intel.com,
	liam.r.girdwood@linux.intel.com, mac.chiang@intel.com,
	akihiko.odaki@gmail.com, ye xingchen <ye.xingchen@zte.com.cn>,
	alsa-devel@alsa-project.org, yung-chuan.liao@linux.intel.com,
	linux-kernel@vger.kernel.org, yong.zhi@intel.com
Subject: Re: [PATCH linux-next] ASoC: Intel: sof_nau8825: use function devm_kcalloc() instead of devm_kzalloc()
Date: Fri, 16 Sep 2022 10:24:16 +0200	[thread overview]
Message-ID: <0cc74fa6-a9f0-ac99-0cba-ca61929feeaf@linux.intel.com> (raw)
In-Reply-To: <20220916062320.153456-1-ye.xingchen@zte.com.cn>



On 9/16/22 08:23, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Use 2-factor multiplication argument form devm_kcalloc() instead
> of devm_kzalloc().
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>


> ---
>  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;
>  	}

  reply	other threads:[~2022-09-16 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  6:23 [PATCH linux-next] ASoC: Intel: sof_nau8825: use function devm_kcalloc() instead of devm_kzalloc() cgel.zte
2022-09-16  6:23 ` cgel.zte
2022-09-16  8:24 ` Pierre-Louis Bossart [this message]
2022-09-16  8:24   ` Pierre-Louis Bossart
2022-09-19 23:09 ` Mark Brown
2022-09-19 23:09   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cc74fa6-a9f0-ac99-0cba-ca61929feeaf@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=akihiko.odaki@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=cgel.zte@gmail.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mac.chiang@intel.com \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=ye.xingchen@zte.com.cn \
    --cc=yong.zhi@intel.com \
    --cc=yung-chuan.liao@linux.intel.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.