linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] nvmem: meson-mx-efuse: replace unnecessary devm_kstrdup()
@ 2022-01-17  2:56 xkernel.wang
  2022-02-14 11:03 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: xkernel.wang @ 2022-01-17  2:56 UTC (permalink / raw)
  To: martin.blumenstingl, srinivas.kandagatla, narmstrong, khilman
  Cc: jbrunet, linux-arm-kernel, linux-amlogic, linux-kernel, Xiaoke Wang

From: Xiaoke Wang <xkernel.wang@foxmail.com>

Replace unnecessary devm_kstrdup() so to avoid redundant memory allocation.

Suggested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
---
Changelogs:
Simplify the patch to replace unnecessary devm_kstrdup().
 drivers/nvmem/meson-mx-efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c
index 07c9f38..13eb143 100644
--- a/drivers/nvmem/meson-mx-efuse.c
+++ b/drivers/nvmem/meson-mx-efuse.c
@@ -209,8 +209,7 @@ static int meson_mx_efuse_probe(struct platform_device *pdev)
 	if (IS_ERR(efuse->base))
 		return PTR_ERR(efuse->base);
 
-	efuse->config.name = devm_kstrdup(&pdev->dev, drvdata->name,
-					  GFP_KERNEL);
+	efuse->config.name = drvdata->name;
 	efuse->config.owner = THIS_MODULE;
 	efuse->config.dev = &pdev->dev;
 	efuse->config.priv = efuse;
-- 

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v2] nvmem: meson-mx-efuse: replace unnecessary devm_kstrdup()
  2022-01-17  2:56 [PATCH v2] nvmem: meson-mx-efuse: replace unnecessary devm_kstrdup() xkernel.wang
@ 2022-02-14 11:03 ` Srinivas Kandagatla
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2022-02-14 11:03 UTC (permalink / raw)
  To: xkernel.wang, martin.blumenstingl, narmstrong, khilman
  Cc: jbrunet, linux-arm-kernel, linux-amlogic, linux-kernel



On 17/01/2022 02:56, xkernel.wang@foxmail.com wrote:
> From: Xiaoke Wang <xkernel.wang@foxmail.com>
> 
> Replace unnecessary devm_kstrdup() so to avoid redundant memory allocation.
> 
> Suggested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>

Applied thanks,

--srini
> ---
> Changelogs:
> Simplify the patch to replace unnecessary devm_kstrdup().
>   drivers/nvmem/meson-mx-efuse.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c
> index 07c9f38..13eb143 100644
> --- a/drivers/nvmem/meson-mx-efuse.c
> +++ b/drivers/nvmem/meson-mx-efuse.c
> @@ -209,8 +209,7 @@ static int meson_mx_efuse_probe(struct platform_device *pdev)
>   	if (IS_ERR(efuse->base))
>   		return PTR_ERR(efuse->base);
>   
> -	efuse->config.name = devm_kstrdup(&pdev->dev, drvdata->name,
> -					  GFP_KERNEL);
> +	efuse->config.name = drvdata->name;
>   	efuse->config.owner = THIS_MODULE;
>   	efuse->config.dev = &pdev->dev;
>   	efuse->config.priv = efuse;

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2022-02-14 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  2:56 [PATCH v2] nvmem: meson-mx-efuse: replace unnecessary devm_kstrdup() xkernel.wang
2022-02-14 11:03 ` Srinivas Kandagatla

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).