Skip to contentSkip to conversation

cpufreq: armada-37xx: stop using 0 as NULL pointer

PATCH Applied Miles Chen 2 participants 2 messages Jan 10, 2023

Subsystems (3)
lore
Share & tools
lore

Miles Chen

author
#0 lore raw

PATCH 1/1 cpufreq: armada-37xx: stop using 0 as NULL pointer

Use NULL for NULL pointer to fix the following sparse warning:
drivers/cpufreq/armada-37xx-cpufreq.c:448:32: sparse: warning: Using plain integer as NULL pointer

---
 drivers/cpufreq/armada-37xx-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/armada-37xx-cpufreq.c +1 -1
index c10fc33b29b1..b74289a95a17 100644
@@ -445,7 +445,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
 		return -ENODEV;
 	}
 
-	clk = clk_get(cpu_dev, 0);
+	clk = clk_get(cpu_dev, NULL);
 	if (IS_ERR(clk)) {
 		dev_err(cpu_dev, "Cannot get clock for CPU0\n");
 		return PTR_ERR(clk);
Signature · 1 line
2.18.0
maintainer Applied
#1 lore raw
Quoted 13 lines · Miles Chen

Use NULL for NULL pointer to fix the following sparse warning:
drivers/cpufreq/armada-37xx-cpufreq.c:448:32: sparse: warning: Using plain integer as NULL pointer

---
 drivers/cpufreq/armada-37xx-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/armada-37xx-cpufreq.c +0 -0
index c10fc33b29b1..b74289a95a17 100644

drivers/cpufreq/armada-37xx-cpufreq.c static int __init armada37xx_cpufreq_driver_init(void) · line 451

Quoted 8 lines
drivers/cpufreq/armada-37xx-cpufreq.c +1 -1
@@ -445,7 +445,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
 		return -ENODEV;
 	}
 
-	clk = clk_get(cpu_dev, 0);
+	clk = clk_get(cpu_dev, NULL);
 	if (IS_ERR(clk)) {
 		dev_err(cpu_dev, "Cannot get clock for CPU0\n");
 		return PTR_ERR(clk);

Applied. Thanks.

Signature · 1 line
viresh