All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: perex@perex.cz, tiwai@suse.com, broonie@kernel.org,
	lgirdwood@gmail.com, deller@gmx.de,
	andriy.shevchenko@linux.intel.com, sre@kernel.org,
	sakari.ailus@linux.intel.com, mchehab@kernel.org,
	hverkuil-cisco@xs4all.nl, jdmason@kudzu.us,
	fancer.lancer@gmail.com, linux-sound@vger.kernel.org,
	linux-fbdev@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-media@vger.kernel.org, ntb@lists.linux.dev,
	linux-kernel@vger.kernel.org, arnd@arndb.de
Subject: Re: [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
Date: Sat, 22 Feb 2025 11:27:06 +0200	[thread overview]
Message-ID: <Z7mYanh-5Q7-cU9j@black.fi.intel.com> (raw)
In-Reply-To: <43c873e1-737a-4119-abb7-49cc51acd6a0@intel.com>

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);
> >  }
> >  
> >  /*
> 

  reply	other threads:[~2025-02-22  9:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=Z7mYanh-5Q7-cU9j@black.fi.intel.com \
    --to=raag.jadav@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=deller@gmx.de \
    --cc=fancer.lancer@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jdmason@kudzu.us \
    --cc=lgirdwood@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ntb@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sre@kernel.org \
    --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 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.