linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 00/13] Convert to use devm_kmemdup_array()
@ 2025-02-21 16:53 Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 01/13] ASoC: Intel: avs: " Raag Jadav
                   ` (16 more replies)
  0 siblings, 17 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

This series is the second wave of patches to add users of newly introduced
devm_kmemdup_array() helper. Original series on [1].

This depends on changes available on immutable tag[2]. Feel free to pick
your subsystem patches with it, or share your preferred way to route them.

[1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
[2] https://lore.kernel.org/r/Z7cqCaME4LxTTBn6@black.fi.intel.com

Raag Jadav (13):
  ASoC: Intel: avs: use devm_kmemdup_array()
  ASoC: hdac_hdmi: use devm_kmemdup_array()
  ASoC: tlv320dac33: use devm_kmemdup_array()
  ASoC: uda1380: use devm_kmemdup_array()
  ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
  ASoC: uniphier: use devm_kmemdup_array()
  fbdev: pxafb: use devm_kmemdup_array()
  power: supply: sc27xx: use devm_kmemdup_array()
  regulator: devres: use devm_kmemdup_array()
  regulator: cros-ec: use devm_kmemdup_array()
  media: atmel-isi: use devm_kmemdup_array()
  media: stm32-dcmi: use devm_kmemdup_array()
  ntb: idt: use devm_kmemdup_array()

 drivers/media/platform/atmel/atmel-isi.c     |  8 ++------
 drivers/media/platform/st/stm32/stm32-dcmi.c |  8 ++------
 drivers/ntb/hw/idt/ntb_hw_idt.c              | 11 +++-------
 drivers/power/supply/sc27xx_fuel_gauge.c     |  5 ++---
 drivers/regulator/cros-ec-regulator.c        |  4 ++--
 drivers/regulator/devres.c                   |  5 ++---
 drivers/video/fbdev/pxafb.c                  | 21 ++++++++------------
 sound/soc/codecs/hdac_hdmi.c                 |  3 +--
 sound/soc/codecs/tlv320dac33.c               |  6 ++----
 sound/soc/codecs/uda1380.c                   |  6 ++----
 sound/soc/intel/avs/boards/da7219.c          |  3 ++-
 sound/soc/intel/avs/boards/es8336.c          |  3 ++-
 sound/soc/intel/avs/boards/nau8825.c         |  3 ++-
 sound/soc/intel/avs/boards/rt274.c           |  3 ++-
 sound/soc/intel/avs/boards/rt286.c           |  3 ++-
 sound/soc/intel/avs/boards/rt298.c           |  3 ++-
 sound/soc/intel/avs/boards/rt5663.c          |  3 ++-
 sound/soc/intel/avs/boards/rt5682.c          |  3 ++-
 sound/soc/meson/axg-tdm-interface.c          |  9 ++-------
 sound/soc/uniphier/aio-cpu.c                 |  8 ++------
 20 files changed, 46 insertions(+), 72 deletions(-)


base-commit: b16e9f8547a328b19af59afc213ce323124d11e9
-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v1 01/13] ASoC: Intel: avs: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 02/13] ASoC: hdac_hdmi: " Raag Jadav
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav, Amadeusz Sławiński,
	Linus Walleij

Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 sound/soc/intel/avs/boards/da7219.c  | 3 ++-
 sound/soc/intel/avs/boards/es8336.c  | 3 ++-
 sound/soc/intel/avs/boards/nau8825.c | 3 ++-
 sound/soc/intel/avs/boards/rt274.c   | 3 ++-
 sound/soc/intel/avs/boards/rt286.c   | 3 ++-
 sound/soc/intel/avs/boards/rt298.c   | 3 ++-
 sound/soc/intel/avs/boards/rt5663.c  | 3 ++-
 sound/soc/intel/avs/boards/rt5682.c  | 3 ++-
 8 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/sound/soc/intel/avs/boards/da7219.c b/sound/soc/intel/avs/boards/da7219.c
index 76078a7005b0..9507a96f26ac 100644
--- a/sound/soc/intel/avs/boards/da7219.c
+++ b/sound/soc/intel/avs/boards/da7219.c
@@ -113,7 +113,8 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime)
 	}
 
 	num_pins = ARRAY_SIZE(card_headset_pins);
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/es8336.c b/sound/soc/intel/avs/boards/es8336.c
index 426ce37105ae..6f3c4f6c9302 100644
--- a/sound/soc/intel/avs/boards/es8336.c
+++ b/sound/soc/intel/avs/boards/es8336.c
@@ -109,7 +109,8 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
 	data = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/nau8825.c b/sound/soc/intel/avs/boards/nau8825.c
index bf902540744c..6833eebd82d6 100644
--- a/sound/soc/intel/avs/boards/nau8825.c
+++ b/sound/soc/intel/avs/boards/nau8825.c
@@ -88,7 +88,8 @@ static int avs_nau8825_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/rt274.c b/sound/soc/intel/avs/boards/rt274.c
index 4b6c02a40204..f5caafc21861 100644
--- a/sound/soc/intel/avs/boards/rt274.c
+++ b/sound/soc/intel/avs/boards/rt274.c
@@ -98,7 +98,8 @@ static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/rt286.c b/sound/soc/intel/avs/boards/rt286.c
index e40563ca99fd..1eb0399c0fae 100644
--- a/sound/soc/intel/avs/boards/rt286.c
+++ b/sound/soc/intel/avs/boards/rt286.c
@@ -59,7 +59,8 @@ static int avs_rt286_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/rt298.c b/sound/soc/intel/avs/boards/rt298.c
index 94fce07c83f9..85269a3be981 100644
--- a/sound/soc/intel/avs/boards/rt298.c
+++ b/sound/soc/intel/avs/boards/rt298.c
@@ -70,7 +70,8 @@ static int avs_rt298_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/rt5663.c b/sound/soc/intel/avs/boards/rt5663.c
index b456b9d14665..e3310b3268ba 100644
--- a/sound/soc/intel/avs/boards/rt5663.c
+++ b/sound/soc/intel/avs/boards/rt5663.c
@@ -65,7 +65,8 @@ static int avs_rt5663_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack = &priv->jack;
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
-	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins,
+				  sizeof(card_headset_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
diff --git a/sound/soc/intel/avs/boards/rt5682.c b/sound/soc/intel/avs/boards/rt5682.c
index 335960cfd7ba..339df0b944c1 100644
--- a/sound/soc/intel/avs/boards/rt5682.c
+++ b/sound/soc/intel/avs/boards/rt5682.c
@@ -102,7 +102,8 @@ static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime)
 	jack = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_jack_pins);
 
-	pins = devm_kmemdup(card->dev, card_jack_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
+	pins = devm_kmemdup_array(card->dev, card_jack_pins, num_pins,
+				  sizeof(card_jack_pins[0]), GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 02/13] ASoC: hdac_hdmi: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 01/13] ASoC: Intel: avs: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 03/13] ASoC: tlv320dac33: " Raag Jadav
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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/codecs/hdac_hdmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index e1a7f0b0c0f3..3bea5d09219a 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1017,8 +1017,7 @@ static int hdac_hdmi_create_pin_port_muxs(struct hdac_device *hdev,
 			return -ENOMEM;
 	}
 
-	se->texts = devm_kmemdup(&hdev->dev, items,
-			(num_items  * sizeof(char *)), GFP_KERNEL);
+	se->texts = devm_kmemdup_array(&hdev->dev, items, num_items, sizeof(items[0]), GFP_KERNEL);
 	if (!se->texts)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 03/13] ASoC: tlv320dac33: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 01/13] ASoC: Intel: avs: " Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 02/13] ASoC: hdac_hdmi: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 04/13] ASoC: uda1380: " Raag Jadav
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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/codecs/tlv320dac33.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index fa46f51d4341..423b9264a205 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -1477,10 +1477,8 @@ static int dac33_i2c_probe(struct i2c_client *client)
 	if (dac33 == NULL)
 		return -ENOMEM;
 
-	dac33->reg_cache = devm_kmemdup(&client->dev,
-					dac33_reg,
-					ARRAY_SIZE(dac33_reg) * sizeof(u8),
-					GFP_KERNEL);
+	dac33->reg_cache = devm_kmemdup_array(&client->dev, dac33_reg, ARRAY_SIZE(dac33_reg),
+					      sizeof(dac33_reg[0]), GFP_KERNEL);
 	if (!dac33->reg_cache)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 04/13] ASoC: uda1380: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (2 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 03/13] ASoC: tlv320dac33: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 05/13] ASoC: meson: axg-tdm-interface: " Raag Jadav
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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/codecs/uda1380.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 4f8fdd574585..c179d865b938 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -766,10 +766,8 @@ static int uda1380_i2c_probe(struct i2c_client *i2c)
 			return ret;
 	}
 
-	uda1380->reg_cache = devm_kmemdup(&i2c->dev,
-					uda1380_reg,
-					ARRAY_SIZE(uda1380_reg) * sizeof(u16),
-					GFP_KERNEL);
+	uda1380->reg_cache = devm_kmemdup_array(&i2c->dev, uda1380_reg, ARRAY_SIZE(uda1380_reg),
+						sizeof(uda1380_reg[0]), GFP_KERNEL);
 	if (!uda1380->reg_cache)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 05/13] ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (3 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 04/13] ASoC: uda1380: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 06/13] ASoC: uniphier: " Raag Jadav
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 sound/soc/meson/axg-tdm-interface.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c
index 09103eef2a97..421b5d719fb3 100644
--- a/sound/soc/meson/axg-tdm-interface.c
+++ b/sound/soc/meson/axg-tdm-interface.c
@@ -529,7 +529,6 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct snd_soc_dai_driver *dai_drv;
 	struct axg_tdm_iface *iface;
-	int i;
 
 	iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL);
 	if (!iface)
@@ -541,15 +540,11 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
 	 * We'll change the number of channel provided by DAI stream, so dpcm
 	 * channel merge can be done properly
 	 */
-	dai_drv = devm_kcalloc(dev, ARRAY_SIZE(axg_tdm_iface_dai_drv),
-			       sizeof(*dai_drv), GFP_KERNEL);
+	dai_drv = devm_kmemdup_array(dev, axg_tdm_iface_dai_drv, ARRAY_SIZE(axg_tdm_iface_dai_drv),
+				     sizeof(axg_tdm_iface_dai_drv[0]), GFP_KERNEL);
 	if (!dai_drv)
 		return -ENOMEM;
 
-	for (i = 0; i < ARRAY_SIZE(axg_tdm_iface_dai_drv); i++)
-		memcpy(&dai_drv[i], &axg_tdm_iface_dai_drv[i],
-		       sizeof(*dai_drv));
-
 	/* Bit clock provided on the pad */
 	iface->sclk = devm_clk_get(dev, "sclk");
 	if (IS_ERR(iface->sclk))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 06/13] ASoC: uniphier: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (4 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 05/13] ASoC: meson: axg-tdm-interface: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 07/13] fbdev: pxafb: " Raag Jadav
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (5 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 06/13] ASoC: uniphier: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 21:41   ` kernel test robot
  2025-02-21 16:53 ` [PATCH v1 08/13] power: supply: sc27xx: " Raag Jadav
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

Convert to use devm_kmemdup() and devm_kmemdup_array() which are
more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/video/fbdev/pxafb.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 4aa84853e31a..21fba33918c6 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2239,26 +2239,21 @@ static int pxafb_probe(struct platform_device *dev)
 
 	ret = -ENOMEM;
 	pdata = dev_get_platdata(&dev->dev);
-	inf = devm_kmalloc(&dev->dev, sizeof(*inf), GFP_KERNEL);
-	if (!inf)
-		goto failed;
-
 	if (pdata) {
-		*inf = *pdata;
-		inf->modes =
-			devm_kmalloc_array(&dev->dev, pdata->num_modes,
-					   sizeof(inf->modes[0]), GFP_KERNEL);
+		inf = devm_kmemdup(&dev->dev, pdata, sizeof(*pdata), GFP_KERNEL);
+		if (!inf)
+			goto failed;
+
+		inf->modes = devm_kmemdup_array(&dev->dev, pdata->modes, pdata->num_modes,
+						sizeof(*pdata->modes), GFP_KERNEL);
 		if (!inf->modes)
 			goto failed;
-		for (i = 0; i < inf->num_modes; i++)
-			inf->modes[i] = pdata->modes[i];
 	} else {
 		inf = of_pxafb_of_mach_info(&dev->dev);
+		if (IS_ERR_OR_NULL(inf))
+			goto failed;
 	}
 
-	if (IS_ERR_OR_NULL(inf))
-		goto failed;
-
 	ret = pxafb_parse_options(&dev->dev, g_options, inf);
 	if (ret < 0)
 		goto failed;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 08/13] power: supply: sc27xx: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (6 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 07/13] fbdev: pxafb: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 09/13] regulator: devres: " Raag Jadav
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/power/supply/sc27xx_fuel_gauge.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index f36edc2ba708..573838ca8ed8 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1014,9 +1014,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
 	if (!table)
 		return -EINVAL;
 
-	data->cap_table = devm_kmemdup(data->dev, table,
-				       data->table_len * sizeof(*table),
-				       GFP_KERNEL);
+	data->cap_table = devm_kmemdup_array(data->dev, table, data->table_len,
+					     sizeof(*table), GFP_KERNEL);
 	if (!data->cap_table) {
 		power_supply_put_battery_info(data->battery, info);
 		return -ENOMEM;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 09/13] regulator: devres: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (7 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 08/13] power: supply: sc27xx: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 10/13] regulator: cros-ec: " Raag Jadav
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/regulator/devres.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 36164aec30e8..ab238579879c 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -332,9 +332,8 @@ int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
 				  const struct regulator_bulk_data *in_consumers,
 				  struct regulator_bulk_data **out_consumers)
 {
-	*out_consumers = devm_kmemdup(dev, in_consumers,
-				      num_consumers * sizeof(*in_consumers),
-				      GFP_KERNEL);
+	*out_consumers = devm_kmemdup_array(dev, in_consumers, num_consumers,
+					    sizeof(*in_consumers), GFP_KERNEL);
 	if (*out_consumers == NULL)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 10/13] regulator: cros-ec: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (8 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 09/13] regulator: devres: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 11/13] media: atmel-isi: " Raag Jadav
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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>
---
 drivers/regulator/cros-ec-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
index fb9643ed7a49..fb0767b33a36 100644
--- a/drivers/regulator/cros-ec-regulator.c
+++ b/drivers/regulator/cros-ec-regulator.c
@@ -138,8 +138,8 @@ static int cros_ec_regulator_init_info(struct device *dev,
 	data->num_voltages =
 		min_t(u16, ARRAY_SIZE(resp.voltages_mv), resp.num_voltages);
 	data->voltages_mV =
-		devm_kmemdup(dev, resp.voltages_mv,
-			     sizeof(u16) * data->num_voltages, GFP_KERNEL);
+		devm_kmemdup_array(dev, resp.voltages_mv, data->num_voltages,
+				   sizeof(resp.voltages_mv[0]), GFP_KERNEL);
 	if (!data->voltages_mV)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 11/13] media: atmel-isi: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (9 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 10/13] regulator: cros-ec: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 12/13] media: stm32-dcmi: " Raag Jadav
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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>
---
 drivers/media/platform/atmel/atmel-isi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 0d1c39347529..7d8bec46af89 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -1072,16 +1072,12 @@ static int isi_formats_init(struct atmel_isi *isi)
 		return -ENXIO;
 
 	isi->num_user_formats = num_fmts;
-	isi->user_formats = devm_kcalloc(isi->dev,
-					 num_fmts, sizeof(struct isi_format *),
-					 GFP_KERNEL);
+	isi->user_formats = devm_kmemdup_array(isi->dev, isi_fmts, num_fmts,
+					       sizeof(isi_fmts[0]), GFP_KERNEL);
 	if (!isi->user_formats)
 		return -ENOMEM;
 
-	memcpy(isi->user_formats, isi_fmts,
-	       num_fmts * sizeof(struct isi_format *));
 	isi->current_fmt = isi->user_formats[0];
-
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 12/13] media: stm32-dcmi: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (10 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 11/13] media: atmel-isi: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 16:53 ` [PATCH v1 13/13] ntb: idt: " Raag Jadav
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

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>
---
 drivers/media/platform/st/stm32/stm32-dcmi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 9b699ee2b1e0..eedc15b30edc 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -1682,18 +1682,14 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
 		return -ENXIO;
 
 	dcmi->num_of_sd_formats = num_fmts;
-	dcmi->sd_formats = devm_kcalloc(dcmi->dev,
-					num_fmts, sizeof(struct dcmi_format *),
-					GFP_KERNEL);
+	dcmi->sd_formats = devm_kmemdup_array(dcmi->dev, sd_fmts, num_fmts,
+					      sizeof(sd_fmts[0]), GFP_KERNEL);
 	if (!dcmi->sd_formats) {
 		dev_err(dcmi->dev, "Could not allocate memory\n");
 		return -ENOMEM;
 	}
 
-	memcpy(dcmi->sd_formats, sd_fmts,
-	       num_fmts * sizeof(struct dcmi_format *));
 	dcmi->sd_format = dcmi->sd_formats[0];
-
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (11 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 12/13] media: stm32-dcmi: " Raag Jadav
@ 2025-02-21 16:53 ` Raag Jadav
  2025-02-21 17:05   ` Dave Jiang
  2025-02-21 22:51 ` (subset) [PATCH v1 00/13] Convert to " Sebastian Reichel
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 27+ messages in thread
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/ntb/hw/idt/ntb_hw_idt.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
index 544d8a4d2af5..dbfc53d0ef0c 100644
--- a/drivers/ntb/hw/idt/ntb_hw_idt.c
+++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
@@ -1103,16 +1103,11 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port,
 		}
 	}
 
-	/* Allocate memory for memory window descriptors */
-	ret_mws = devm_kcalloc(&ndev->ntb.pdev->dev, *mw_cnt, sizeof(*ret_mws),
-			       GFP_KERNEL);
-	if (!ret_mws)
-		return ERR_PTR(-ENOMEM);
-
 	/* Copy the info of detected memory windows */
-	memcpy(ret_mws, mws, (*mw_cnt)*sizeof(*ret_mws));
+	ret_mws = devm_kmemdup_array(&ndev->ntb.pdev->dev, mws, *mw_cnt,
+				     sizeof(mws[0]), GFP_KERNEL);
 
-	return ret_mws;
+	return ret_mws ?: ERR_PTR(-ENOMEM);
 }
 
 /*
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
  2025-02-21 16:53 ` [PATCH v1 13/13] ntb: idt: " Raag Jadav
@ 2025-02-21 17:05   ` Dave Jiang
  2025-02-22  9:27     ` Raag Jadav
  0 siblings, 1 reply; 27+ messages in thread
From: Dave Jiang @ 2025-02-21 17:05 UTC (permalink / raw)
  To: Raag Jadav, perex, tiwai, broonie, lgirdwood, deller,
	andriy.shevchenko, sre, sakari.ailus, mchehab, hverkuil-cisco,
	jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel



On 2/21/25 9:53 AM, Raag Jadav wrote:
> Convert to use devm_kmemdup_array() which is more robust.
> 
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>

I think this patch [1] from earlier today makes this change unnecessary now.

[1]: https://lore.kernel.org/ntb/20250221085748.2298463-1-arnd@kernel.org/

> ---
>  drivers/ntb/hw/idt/ntb_hw_idt.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
> index 544d8a4d2af5..dbfc53d0ef0c 100644
> --- a/drivers/ntb/hw/idt/ntb_hw_idt.c
> +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
> @@ -1103,16 +1103,11 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port,
>  		}
>  	}
>  
> -	/* Allocate memory for memory window descriptors */
> -	ret_mws = devm_kcalloc(&ndev->ntb.pdev->dev, *mw_cnt, sizeof(*ret_mws),
> -			       GFP_KERNEL);
> -	if (!ret_mws)
> -		return ERR_PTR(-ENOMEM);
> -
>  	/* Copy the info of detected memory windows */
> -	memcpy(ret_mws, mws, (*mw_cnt)*sizeof(*ret_mws));
> +	ret_mws = devm_kmemdup_array(&ndev->ntb.pdev->dev, mws, *mw_cnt,
> +				     sizeof(mws[0]), GFP_KERNEL);
>  
> -	return ret_mws;
> +	return ret_mws ?: ERR_PTR(-ENOMEM);
>  }
>  
>  /*


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-21 16:53 ` [PATCH v1 07/13] fbdev: pxafb: " Raag Jadav
@ 2025-02-21 21:41   ` kernel test robot
  2025-02-24 10:58     ` Andy Shevchenko
  0 siblings, 1 reply; 27+ messages in thread
From: kernel test robot @ 2025-02-21 21:41 UTC (permalink / raw)
  To: Raag Jadav, perex, tiwai, broonie, lgirdwood, deller,
	andriy.shevchenko, sre, sakari.ailus, mchehab, hverkuil-cisco,
	jdmason, fancer.lancer
  Cc: oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel, Raag Jadav

Hi Raag,

kernel test robot noticed the following build warnings:

[auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]

url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
base:   b16e9f8547a328b19af59afc213ce323124d11e9
patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
>> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
    2236 |         int i, irq, ret;
         |             ^


vim +/i +2236 drivers/video/fbdev/pxafb.c

420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2231  
48c68c4f1b5424 drivers/video/pxafb.c       Greg Kroah-Hartman 2012-12-21  2232  static int pxafb_probe(struct platform_device *dev)
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2233  {
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2234  	struct pxafb_info *fbi;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2235  	struct pxafb_mach_info *inf, *pdata;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12 @2236  	int i, irq, ret;
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2237  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2238  	dev_dbg(&dev->dev, "pxafb_probe\n");
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2239  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2240  	ret = -ENOMEM;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2241  	pdata = dev_get_platdata(&dev->dev);
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2242  	if (pdata) {
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2243  		inf = devm_kmemdup(&dev->dev, pdata, sizeof(*pdata), GFP_KERNEL);
6f6abd360603af drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-19  2244  		if (!inf)
6f6abd360603af drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-19  2245  			goto failed;
420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2246  
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2247  		inf->modes = devm_kmemdup_array(&dev->dev, pdata->modes, pdata->num_modes,
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2248  						sizeof(*pdata->modes), GFP_KERNEL);
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2249  		if (!inf->modes)
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2250  			goto failed;
b23e868d35d572 drivers/video/fbdev/pxafb.c Wang Qing          2022-03-29  2251  	} else {
b23e868d35d572 drivers/video/fbdev/pxafb.c Wang Qing          2022-03-29  2252  		inf = of_pxafb_of_mach_info(&dev->dev);
420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2253  		if (IS_ERR_OR_NULL(inf))
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2254  			goto failed;
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2255  	}
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2256  
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2257  	ret = pxafb_parse_options(&dev->dev, g_options, inf);
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2258  	if (ret < 0)
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2259  		goto failed;
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2260  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2261  	pxafb_check_options(&dev->dev, inf);
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2262  
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2263  	dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2264  			inf->modes->xres,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2265  			inf->modes->yres,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2266  			inf->modes->bpp);
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2267  	if (inf->modes->xres == 0 ||
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2268  	    inf->modes->yres == 0 ||
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2269  	    inf->modes->bpp == 0) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2270  		dev_err(&dev->dev, "Invalid resolution or bit depth\n");
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2271  		ret = -EINVAL;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2272  		goto failed;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2273  	}
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2274  
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2275  	fbi = pxafb_init_fbinfo(&dev->dev, inf);
a2f2058e3d295f drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2276  	if (IS_ERR(fbi)) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2277  		dev_err(&dev->dev, "Failed to initialize framebuffer device\n");
a2f2058e3d295f drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2278  		ret = PTR_ERR(fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2279  		goto failed;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2280  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2281  
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2282  	if (cpu_is_pxa3xx() && inf->acceleration_enabled)
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2283  		fbi->fb.fix.accel = FB_ACCEL_PXA3XX;
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2284  
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2285  	fbi->backlight_power = inf->pxafb_backlight_power;
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2286  	fbi->lcd_power = inf->pxafb_lcd_power;
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2287  
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2288  	fbi->lcd_supply = devm_regulator_get_optional(&dev->dev, "lcd");
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2289  	if (IS_ERR(fbi->lcd_supply)) {
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2290  		if (PTR_ERR(fbi->lcd_supply) == -EPROBE_DEFER)
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2291  			return -EPROBE_DEFER;
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2292  
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2293  		fbi->lcd_supply = NULL;
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2294  	}
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2295  
7610bca71ea85d drivers/video/fbdev/pxafb.c Markus Elfring     2019-09-19  2296  	fbi->mmio_base = devm_platform_ioremap_resource(dev, 0);
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2297  	if (IS_ERR(fbi->mmio_base)) {
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2298  		dev_err(&dev->dev, "failed to get I/O memory\n");
f35b1d6c21b414 drivers/video/fbdev/pxafb.c Tiezhu Yang        2020-05-25  2299  		ret = PTR_ERR(fbi->mmio_base);
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2300  		goto failed;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2301  	}
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2302  
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2303  	fbi->dma_buff_size = PAGE_ALIGN(sizeof(struct pxafb_dma_buff));
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2304  	fbi->dma_buff = dma_alloc_coherent(fbi->dev, fbi->dma_buff_size,
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2305  				&fbi->dma_buff_phys, GFP_KERNEL);
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2306  	if (fbi->dma_buff == NULL) {
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2307  		dev_err(&dev->dev, "failed to allocate memory for DMA\n");
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2308  		ret = -ENOMEM;
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2309  		goto failed;
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2310  	}
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2311  
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2312  	ret = pxafb_init_video_memory(fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2313  	if (ret) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2314  		dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2315  		ret = -ENOMEM;
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2316  		goto failed_free_dma;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2317  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2318  
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2319  	irq = platform_get_irq(dev, 0);
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2320  	if (irq < 0) {
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2321  		ret = -ENODEV;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2322  		goto failed_free_mem;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2323  	}
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2324  
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2325  	ret = devm_request_irq(&dev->dev, irq, pxafb_handle_irq, 0, "LCD", fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2326  	if (ret) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2327  		dev_err(&dev->dev, "request_irq failed: %d\n", ret);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2328  		ret = -EBUSY;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2329  		goto failed_free_mem;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2330  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2331  
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2332  	ret = pxafb_smart_init(fbi);
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2333  	if (ret) {
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2334  		dev_err(&dev->dev, "failed to initialize smartpanel\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2335  		goto failed_free_mem;
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2336  	}
07df1c4fea1474 drivers/video/pxafb.c       Eric Miao          2008-12-04  2337  
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2338  	/*
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2339  	 * This makes sure that our colour bitfield
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2340  	 * descriptors are correctly initialised.
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2341  	 */
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2342  	ret = pxafb_check_var(&fbi->fb.var, &fbi->fb);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2343  	if (ret) {
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2344  		dev_err(&dev->dev, "failed to get suitable mode\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2345  		goto failed_free_mem;
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2346  	}
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2347  
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2348  	ret = pxafb_set_par(&fbi->fb);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2349  	if (ret) {
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2350  		dev_err(&dev->dev, "Failed to set parameters\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2351  		goto failed_free_mem;
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2352  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2353  
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2354  	platform_set_drvdata(dev, fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2355  
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2356  	ret = register_framebuffer(&fbi->fb);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2357  	if (ret < 0) {
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2358  		dev_err(&dev->dev,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2359  			"Failed to register framebuffer device: %d\n", ret);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2360  		goto failed_free_cmap;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2361  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2362  
198fc108ee4c2c drivers/video/pxafb.c       Eric Miao          2008-12-23  2363  	pxafb_overlay_init(fbi);
198fc108ee4c2c drivers/video/pxafb.c       Eric Miao          2008-12-23  2364  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: (subset) [PATCH v1 00/13] Convert to use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (12 preceding siblings ...)
  2025-02-21 16:53 ` [PATCH v1 13/13] ntb: idt: " Raag Jadav
@ 2025-02-21 22:51 ` Sebastian Reichel
  2025-02-24 12:39 ` Raag Jadav
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2025-02-21 22:51 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, jdmason, fancer.lancer, Hans Verkuil,
	Raag Jadav
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel


On Fri, 21 Feb 2025 22:23:20 +0530, Raag Jadav wrote:
> This series is the second wave of patches to add users of newly introduced
> devm_kmemdup_array() helper. Original series on [1].
> 
> This depends on changes available on immutable tag[2]. Feel free to pick
> your subsystem patches with it, or share your preferred way to route them.
> 
> [1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
> [2] https://lore.kernel.org/r/Z7cqCaME4LxTTBn6@black.fi.intel.com
> 
> [...]

Applied, thanks!

[08/13] power: supply: sc27xx: use devm_kmemdup_array()
        commit: 0c3cbeb89c49f47ce6cae9250c8ff6c8f3cdf232

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
  2025-02-21 17:05   ` Dave Jiang
@ 2025-02-22  9:27     ` Raag Jadav
  0 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-22  9:27 UTC (permalink / raw)
  To: Dave Jiang
  Cc: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, arnd

Cc: Arnd

On Fri, Feb 21, 2025 at 10:05:09AM -0700, Dave Jiang wrote:
> On 2/21/25 9:53 AM, Raag Jadav wrote:
> > Convert to use devm_kmemdup_array() which is more robust.
> > 
> > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> 
> I think this patch [1] from earlier today makes this change unnecessary now.
> 
> [1]: https://lore.kernel.org/ntb/20250221085748.2298463-1-arnd@kernel.org/

Sure, in that case we can drop this one. Thanks for noticing.

Raag

> > ---
> >  drivers/ntb/hw/idt/ntb_hw_idt.c | 11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
> > index 544d8a4d2af5..dbfc53d0ef0c 100644
> > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c
> > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
> > @@ -1103,16 +1103,11 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port,
> >  		}
> >  	}
> >  
> > -	/* Allocate memory for memory window descriptors */
> > -	ret_mws = devm_kcalloc(&ndev->ntb.pdev->dev, *mw_cnt, sizeof(*ret_mws),
> > -			       GFP_KERNEL);
> > -	if (!ret_mws)
> > -		return ERR_PTR(-ENOMEM);
> > -
> >  	/* Copy the info of detected memory windows */
> > -	memcpy(ret_mws, mws, (*mw_cnt)*sizeof(*ret_mws));
> > +	ret_mws = devm_kmemdup_array(&ndev->ntb.pdev->dev, mws, *mw_cnt,
> > +				     sizeof(mws[0]), GFP_KERNEL);
> >  
> > -	return ret_mws;
> > +	return ret_mws ?: ERR_PTR(-ENOMEM);
> >  }
> >  
> >  /*
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-21 21:41   ` kernel test robot
@ 2025-02-24 10:58     ` Andy Shevchenko
  2025-02-24 11:24       ` Raag Jadav
  0 siblings, 1 reply; 27+ messages in thread
From: Andy Shevchenko @ 2025-02-24 10:58 UTC (permalink / raw)
  To: kernel test robot
  Cc: Raag Jadav, perex, tiwai, broonie, lgirdwood, deller, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel

On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> Hi Raag,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> base:   b16e9f8547a328b19af59afc213ce323124d11e9
> patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
>     2236 |         int i, irq, ret;
>          |             ^

Ragg, please, fix this, and issue a v2 with the link to fixed PR:
https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-24 10:58     ` Andy Shevchenko
@ 2025-02-24 11:24       ` Raag Jadav
  2025-02-24 11:41         ` Andy Shevchenko
  0 siblings, 1 reply; 27+ messages in thread
From: Raag Jadav @ 2025-02-24 11:24 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: kernel test robot, perex, tiwai, broonie, lgirdwood, deller, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel

On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > Hi Raag,
> > 
> > kernel test robot noticed the following build warnings:
> > 
> > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > 
> > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> >     2236 |         int i, irq, ret;
> >          |             ^
> 
> Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.

Sure, but perhaps wait a few days for review comments.

Raag

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-24 11:24       ` Raag Jadav
@ 2025-02-24 11:41         ` Andy Shevchenko
  2025-02-24 12:22           ` Raag Jadav
  0 siblings, 1 reply; 27+ messages in thread
From: Andy Shevchenko @ 2025-02-24 11:41 UTC (permalink / raw)
  To: Raag Jadav
  Cc: kernel test robot, perex, tiwai, broonie, lgirdwood, deller, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel

On Mon, Feb 24, 2025 at 01:24:08PM +0200, Raag Jadav wrote:
> On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> > On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > > Hi Raag,
> > > 
> > > kernel test robot noticed the following build warnings:
> > > 
> > > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > > 
> > > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > > 
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > > 
> > > All warnings (new ones prefixed by >>):
> > > 
> > >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> > >     2236 |         int i, irq, ret;
> > >          |             ^
> > 
> > Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> > https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
> 
> Sure, but perhaps wait a few days for review comments.

Then perhaps answering to the cover letter that the maintainers who want to
apply should use the updated PR?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-24 11:41         ` Andy Shevchenko
@ 2025-02-24 12:22           ` Raag Jadav
  2025-02-24 12:28             ` Andy Shevchenko
  0 siblings, 1 reply; 27+ messages in thread
From: Raag Jadav @ 2025-02-24 12:22 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: kernel test robot, perex, tiwai, broonie, lgirdwood, deller, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel

On Mon, Feb 24, 2025 at 01:41:05PM +0200, Andy Shevchenko wrote:
> On Mon, Feb 24, 2025 at 01:24:08PM +0200, Raag Jadav wrote:
> > On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> > > On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > > > Hi Raag,
> > > > 
> > > > kernel test robot noticed the following build warnings:
> > > > 
> > > > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > > > 
> > > > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > > > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > > > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > > > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > > > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > > > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > > > 
> > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > the same patch/commit), kindly add following tags
> > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > > > 
> > > > All warnings (new ones prefixed by >>):
> > > > 
> > > >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > > > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> > > >     2236 |         int i, irq, ret;
> > > >          |             ^
> > > 
> > > Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> > > https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
> > 
> > Sure, but perhaps wait a few days for review comments.
> 
> Then perhaps answering to the cover letter that the maintainers who want to
> apply should use the updated PR?

Okay, but I'm not sure how this plays out for those who already pulled
the old PR, i.e. Sebastian.

Anything to worry about here?

Raag

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
  2025-02-24 12:22           ` Raag Jadav
@ 2025-02-24 12:28             ` Andy Shevchenko
  0 siblings, 0 replies; 27+ messages in thread
From: Andy Shevchenko @ 2025-02-24 12:28 UTC (permalink / raw)
  To: Raag Jadav
  Cc: kernel test robot, perex, tiwai, broonie, lgirdwood, deller, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel

On Mon, Feb 24, 2025 at 02:22:07PM +0200, Raag Jadav wrote:
> On Mon, Feb 24, 2025 at 01:41:05PM +0200, Andy Shevchenko wrote:
> > On Mon, Feb 24, 2025 at 01:24:08PM +0200, Raag Jadav wrote:
> > > On Mon, Feb 24, 2025 at 12:58:35PM +0200, Andy Shevchenko wrote:
> > > > On Sat, Feb 22, 2025 at 05:41:24AM +0800, kernel test robot wrote:
> > > > > Hi Raag,
> > > > > 
> > > > > kernel test robot noticed the following build warnings:
> > > > > 
> > > > > [auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]
> > > > > 
> > > > > url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
> > > > > base:   b16e9f8547a328b19af59afc213ce323124d11e9
> > > > > patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
> > > > > patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
> > > > > config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
> > > > > compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
> > > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)
> > > > > 
> > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > > the same patch/commit), kindly add following tags
> > > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/
> > > > > 
> > > > > All warnings (new ones prefixed by >>):
> > > > > 
> > > > >    drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
> > > > > >> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
> > > > >     2236 |         int i, irq, ret;
> > > > >          |             ^
> > > > 
> > > > Ragg, please, fix this, and issue a v2 with the link to fixed PR:
> > > > https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com.
> > > 
> > > Sure, but perhaps wait a few days for review comments.
> > 
> > Then perhaps answering to the cover letter that the maintainers who want to
> > apply should use the updated PR?
> 
> Okay, but I'm not sure how this plays out for those who already pulled
> the old PR, i.e. Sebastian.
> 
> Anything to worry about here?

I already informed him and Stephen about a new PR I just sent a few hours ago.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 00/13] Convert to use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (13 preceding siblings ...)
  2025-02-21 22:51 ` (subset) [PATCH v1 00/13] Convert to " Sebastian Reichel
@ 2025-02-24 12:39 ` Raag Jadav
  2025-02-24 13:46 ` Mark Brown
  2025-02-28 21:22 ` (subset) " Mark Brown
  16 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-24 12:39 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel

On Fri, Feb 21, 2025 at 10:23:20PM +0530, Raag Jadav wrote:
> This series is the second wave of patches to add users of newly introduced
> devm_kmemdup_array() helper. Original series on [1].
> 
> This depends on changes available on immutable tag[2]. Feel free to pick
> your subsystem patches with it, or share your preferred way to route them.
> 
> [1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
> [2] https://lore.kernel.org/r/Z7cqCaME4LxTTBn6@black.fi.intel.com

Update: Anyone wishing to pull from this series, please use the updated
tag[3]. I'll wait for a few days for review comments and send out a v2
with fbdev fix.

[3] https://lore.kernel.org/r/Z7xGpz3Q4Zj6YHx7@black.fi.intel.com

Apologies for the inconvenience.

Raag

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 00/13] Convert to use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (14 preceding siblings ...)
  2025-02-24 12:39 ` Raag Jadav
@ 2025-02-24 13:46 ` Mark Brown
  2025-02-24 14:29   ` Raag Jadav
  2025-02-28 21:22 ` (subset) " Mark Brown
  16 siblings, 1 reply; 27+ messages in thread
From: Mark Brown @ 2025-02-24 13:46 UTC (permalink / raw)
  To: Raag Jadav
  Cc: perex, tiwai, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

On Fri, Feb 21, 2025 at 10:23:20PM +0530, Raag Jadav wrote:
> This series is the second wave of patches to add users of newly introduced
> devm_kmemdup_array() helper. Original series on [1].
> 
> This depends on changes available on immutable tag[2]. Feel free to pick
> your subsystem patches with it, or share your preferred way to route them.

Please don't combine patches for multiple subsystems into a single patch
series, it just makes everything more complex to deal with - it creates
cross tree issues that wouldn't otherwise exist.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v1 00/13] Convert to use devm_kmemdup_array()
  2025-02-24 13:46 ` Mark Brown
@ 2025-02-24 14:29   ` Raag Jadav
  0 siblings, 0 replies; 27+ messages in thread
From: Raag Jadav @ 2025-02-24 14:29 UTC (permalink / raw)
  To: Mark Brown
  Cc: perex, tiwai, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel

On Mon, Feb 24, 2025 at 01:46:29PM +0000, Mark Brown wrote:
> On Fri, Feb 21, 2025 at 10:23:20PM +0530, Raag Jadav wrote:
> > This series is the second wave of patches to add users of newly introduced
> > devm_kmemdup_array() helper. Original series on [1].
> > 
> > This depends on changes available on immutable tag[2]. Feel free to pick
> > your subsystem patches with it, or share your preferred way to route them.
> 
> Please don't combine patches for multiple subsystems into a single patch
> series, it just makes everything more complex to deal with - it creates
> cross tree issues that wouldn't otherwise exist.

Sure, will split v2 per subsystem.

Raag

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: (subset) [PATCH v1 00/13] Convert to use devm_kmemdup_array()
  2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
                   ` (15 preceding siblings ...)
  2025-02-24 13:46 ` Mark Brown
@ 2025-02-28 21:22 ` Mark Brown
  16 siblings, 0 replies; 27+ messages in thread
From: Mark Brown @ 2025-02-28 21:22 UTC (permalink / raw)
  To: perex, tiwai, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, jdmason, fancer.lancer, Hans Verkuil,
	Raag Jadav
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel

On Fri, 21 Feb 2025 22:23:20 +0530, Raag Jadav wrote:
> This series is the second wave of patches to add users of newly introduced
> devm_kmemdup_array() helper. Original series on [1].
> 
> This depends on changes available on immutable tag[2]. Feel free to pick
> your subsystem patches with it, or share your preferred way to route them.
> 
> [1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
> [2] https://lore.kernel.org/r/Z7cqCaME4LxTTBn6@black.fi.intel.com
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[09/13] regulator: devres: use devm_kmemdup_array()
        commit: 6ddd1159825c516b8f64fda83177c161434141f5
[10/13] regulator: cros-ec: use devm_kmemdup_array()
        commit: c5c4ce6612bb25ce6d6936d8ade96fcba635da54

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-02-28 21:22 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21 16:53 [PATCH v1 00/13] Convert to use devm_kmemdup_array() Raag Jadav
2025-02-21 16:53 ` [PATCH v1 01/13] ASoC: Intel: avs: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 02/13] ASoC: hdac_hdmi: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 03/13] ASoC: tlv320dac33: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 04/13] ASoC: uda1380: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 05/13] ASoC: meson: axg-tdm-interface: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 06/13] ASoC: uniphier: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 07/13] fbdev: pxafb: " Raag Jadav
2025-02-21 21:41   ` kernel test robot
2025-02-24 10:58     ` Andy Shevchenko
2025-02-24 11:24       ` Raag Jadav
2025-02-24 11:41         ` Andy Shevchenko
2025-02-24 12:22           ` Raag Jadav
2025-02-24 12:28             ` Andy Shevchenko
2025-02-21 16:53 ` [PATCH v1 08/13] power: supply: sc27xx: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 09/13] regulator: devres: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 10/13] regulator: cros-ec: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 11/13] media: atmel-isi: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 12/13] media: stm32-dcmi: " Raag Jadav
2025-02-21 16:53 ` [PATCH v1 13/13] ntb: idt: " Raag Jadav
2025-02-21 17:05   ` Dave Jiang
2025-02-22  9:27     ` Raag Jadav
2025-02-21 22:51 ` (subset) [PATCH v1 00/13] Convert to " Sebastian Reichel
2025-02-24 12:39 ` Raag Jadav
2025-02-24 13:46 ` Mark Brown
2025-02-24 14:29   ` Raag Jadav
2025-02-28 21:22 ` (subset) " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).