Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2228296rwn; Fri, 16 Sep 2022 07:27:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48zTyoy+DGPfYLhBFisEQM73hgZUMdZjeCChAiqSyngL+cbo22Qq1PqyH6nevW7yAYlNUg X-Received: by 2002:a05:6402:26d2:b0:451:5a8c:346b with SMTP id x18-20020a05640226d200b004515a8c346bmr4110850edd.424.1663338471734; Fri, 16 Sep 2022 07:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663338471; cv=none; d=google.com; s=arc-20160816; b=DbfgSjfRnqETI/sOYV3driKKoJUhTzoTCyWbTE6j6wzXE258dqWtzkBSMUfIHpOK5f h6edvOrqVDV3Xi6+q0lcUS2Cqe1sIg8+d2E5W9jz6T89JRYcEJqG5bqMOBKKVROjvy3A pz3aOW6Kh/oj9JZxVGHWoYHffO7Ffzd+3pQtmiFlkydCGtHlv1Yx4Ped3HBXVXqS1H4+ qa5Jq6Vdw9dfVn7FvPJ+ARkKWoX6iqAnhtKe592hpFQYnsnO60jxqHoT7HR7vp6KOaXf FYU8U2S1iPozqvo1IUt41N1ykmi/1885zeYeGy6Cxl6uEXjdSaCEwk0yi8C2cgWmvPyi JXSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=INRvmNOTJ1HEHZF0IgpmeHiKF7Lf1/4//nZEtHYcsZ8=; b=UR89L4EVLAZfVmozfiVIrvGUvfe6yoLlS8AnfGYW3DgBXW9pw4x9IrkIjqboJo52q4 kj8m+wBlEJtL7n3UrquDgOGghsv6aMqz0yiBAL/kkc+HrZ8gg/4hE54I9UUcs7aQKgLa xqCNink6kehBwFcUgxiTzrfNlBc7QAIDcS4Y1BZQ5ihWJZf1CT7RnZhWIxGvBRR5NdqO kBwjDPe6Gp7E2BDp5USjlFi8JfpavBNMSk/sKLAcwFdzULg/hYEcx1i2W5eePYCJhZ9K nGVVa3q4R2YIofZzsl4kHXfPtKAl9HL34vUTOVjTqhXr8sWw3f5L/L5TUCzRkBEe45z8 PFPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rfw6l4tG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a05640227d000b0044e6731ad3esi2889624ede.400.2022.09.16.07.27.26; Fri, 16 Sep 2022 07:27:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rfw6l4tG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231518AbiIPOYh (ORCPT + 99 others); Fri, 16 Sep 2022 10:24:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232048AbiIPOYa (ORCPT ); Fri, 16 Sep 2022 10:24:30 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38504324 for ; Fri, 16 Sep 2022 07:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663338267; x=1694874267; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=TUTrrnnUNzMDWn7idCm1PdQx1UFNwdQB3+BXN34GGsE=; b=Rfw6l4tGrz16/rS1r9o5gH3fw2Lgs+Wc/t3w+6WKjmGwdu/T/gebyJ+h djV+hTKmtq1zBBQ4EcAMMgj3RFqxsxzVT39Gv0dMs1C/6bQGR6CN7L5YM w0sJ4machLtClSUNgm5WFsI2vkc8838KjM+byM6WHZB0qOmNLe8qTn/dh +jYdnn50c9UKVz2aA9YRrr2yrA5doengk+NAkZjHit+bU5cTsteP0s/8c VQrL0cQ5AS2ueWIjrkuEfEwpNPxpX/WuMI8pH5NcjnTVHLknapa97W6if dRKLEs9frso/DnjNfsFCoaz7v7UJ5wwlo+vE7o4SG1wlcWH5cbDnyNNqn g==; X-IronPort-AV: E=McAfee;i="6500,9779,10472"; a="278729565" X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="278729565" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2022 07:24:21 -0700 X-IronPort-AV: E=Sophos;i="5.93,320,1654585200"; d="scan'208";a="650889049" 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:15 -0700 Message-ID: <60ca20b7-c636-000c-c146-a46e52762691@linux.intel.com> Date: Fri, 16 Sep 2022 10:25:35 +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_ssp_amp: use 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, brent.lu@intel.com, akihiko.odaki@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ye xingchen , Zeal Robot References: <20220916062549.154114-1-ye.xingchen@zte.com.cn> From: Pierre-Louis Bossart In-Reply-To: <20220916062549.154114-1-ye.xingchen@zte.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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/intel/boards/sof_ssp_amp.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/sound/soc/intel/boards/sof_ssp_amp.c b/sound/soc/intel/boards/sof_ssp_amp.c > index 4a762e002ac7..94d25aeb6e7c 100644 > --- a/sound/soc/intel/boards/sof_ssp_amp.c > +++ b/sound/soc/intel/boards/sof_ssp_amp.c > @@ -210,10 +210,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_ssp_amp_card.num_links, GFP_KERNEL); > - cpus = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component) * > - sof_ssp_amp_card.num_links, GFP_KERNEL); > + links = devm_kcalloc(dev, sof_ssp_amp_card.num_links, > + sizeof(struct snd_soc_dai_link), GFP_KERNEL); > + cpus = devm_kcalloc(dev, sof_ssp_amp_card.num_links, > + sizeof(struct snd_soc_dai_link_component), GFP_KERNEL); > if (!links || !cpus) > return NULL; > > @@ -306,9 +306,10 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, > if (sof_ssp_amp_quirk & SOF_HDMI_PLAYBACK_PRESENT) { > /* 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; > }