irqchip/qcom-mpm: Replace devm_kasprintf() call by devm_kstrdup() in qcom_mpm_init()
Subsystems (2)
PATCH 1/1 irqchip/qcom-mpm: Replace devm_kasprintf() call by devm_kstrdup() in qcom_mpm_init()
From: Markus Elfring <[email protected]>
Date: Wed, 16 Apr 2025 15:43:46 +0200
Use a devm_kstrdup() call instead of a devm_kasprintf() call in this function implementation because only a single string should be copied.
The source code was transformed by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/irqchip/irq-qcom-mpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-qcom-mpm.c +1 -1
@@ -414,7 +414,7 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent) genpd->flags =GENPD_FLAG_IRQ_SAFE ; genpd->power_off = mpm_pd_power_off; - genpd->name =devm_kasprintf (dev,GFP_KERNEL ,"%s" ,dev_name (dev)); + genpd->name =devm_kstrdup (dev,dev_name (dev),GFP_KERNEL );if (!genpd->name)return -ENOMEM ;
Signature · 1 line
2.49.0