[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z0Z3kng9q2JfR6JU@google.com>
Date: Tue, 26 Nov 2024 17:36:18 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Raag Jadav <raag.jadav@...el.com>
Cc: gregkh@...uxfoundation.org, linus.walleij@...aro.org,
mika.westerberg@...ux.intel.com, andriy.shevchenko@...ux.intel.com,
broonie@...nel.org, pierre-louis.bossart@...ux.dev,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org, linux-sound@...r.kernel.org
Subject: Re: [PATCH v2 1/6] devres: Introduce devm_kmemdup_array()
On Tue, Nov 26, 2024 at 10:52:35PM +0530, Raag Jadav wrote:
> Introduce '_array' variant of devm_kmemdup() which is more robust and
> consistent with alloc family of helpers.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Raag Jadav <raag.jadav@...el.com>
Thank you for making the changes.
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> ---
> include/linux/device.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index b4bde8d22697..c2032aab1586 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -358,6 +358,11 @@ char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc;
> const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp);
> void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp)
> __realloc_size(3);
> +static inline void *devm_kmemdup_array(struct device *dev, const void *src,
> + size_t n, size_t size, gfp_t flags)
> +{
> + return devm_kmemdup(dev, src, size_mul(size, n), flags);
> +}
>
> unsigned long devm_get_free_pages(struct device *dev,
> gfp_t gfp_mask, unsigned int order);
> --
> 2.35.3
>
--
Dmitry
Powered by blists - more mailing lists