From: Raag Jadav <raag.jadav@intel.com>
To: perex@perex.cz, tiwai@suse.com, broonie@kernel.org,
lgirdwood@gmail.com, andriy.shevchenko@linux.intel.com,
cezary.rojewski@intel.com, amadeuszx.slawinski@linux.intel.com,
shenghao-ding@ti.com, kevin-lu@ti.com, baojun.xu@ti.com,
jbrunet@baylibre.com, neil.armstrong@linaro.org,
khilman@baylibre.com, hayashi.kunihiko@socionext.com,
mhiramat@kernel.org
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v2 6/6] ASoC: uniphier: use devm_kmemdup_array()
Date: Fri, 28 Feb 2025 11:58:12 +0530 [thread overview]
Message-ID: <20250228062812.150004-7-raag.jadav@intel.com> (raw)
In-Reply-To: <20250228062812.150004-1-raag.jadav@intel.com>
Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
sound/soc/uniphier/aio-cpu.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c
index 470f129166a4..3224c11a527f 100644
--- a/sound/soc/uniphier/aio-cpu.c
+++ b/sound/soc/uniphier/aio-cpu.c
@@ -762,14 +762,10 @@ int uniphier_aio_probe(struct platform_device *pdev)
return -ENOMEM;
chip->num_plls = chip->chip_spec->num_plls;
- chip->plls = devm_kcalloc(dev,
- chip->num_plls,
- sizeof(struct uniphier_aio_pll),
- GFP_KERNEL);
+ chip->plls = devm_kmemdup_array(dev, chip->chip_spec->plls, chip->num_plls,
+ sizeof(*chip->chip_spec->plls), GFP_KERNEL);
if (!chip->plls)
return -ENOMEM;
- memcpy(chip->plls, chip->chip_spec->plls,
- sizeof(struct uniphier_aio_pll) * chip->num_plls);
for (i = 0; i < chip->num_aios; i++) {
struct uniphier_aio *aio = &chip->aios[i];
--
2.34.1
next prev parent reply other threads:[~2025-02-28 6:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 6:28 [PATCH v2 0/6] Convert sound drivers to use devm_kmemdup_array() Raag Jadav
2025-02-28 6:28 ` [PATCH v2 1/6] ASoC: Intel: avs: " Raag Jadav
2025-02-28 6:28 ` [PATCH v2 2/6] ASoC: hdac_hdmi: " Raag Jadav
2025-02-28 6:28 ` [PATCH v2 3/6] ASoC: tlv320dac33: " Raag Jadav
2025-02-28 6:28 ` [PATCH v2 4/6] ASoC: uda1380: " Raag Jadav
2025-02-28 6:28 ` [PATCH v2 5/6] ASoC: meson: axg-tdm-interface: " Raag Jadav
2025-02-28 6:28 ` Raag Jadav [this message]
2025-02-28 21:22 ` [PATCH v2 0/6] Convert sound drivers to " 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=20250228062812.150004-7-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=jbrunet@baylibre.com \
--cc=kevin-lu@ti.com \
--cc=khilman@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=perex@perex.cz \
--cc=shenghao-ding@ti.com \
--cc=tiwai@suse.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox