* [bug report] cpufreq: mediatek-hw: Add support for MT8196
@ 2025-08-19 7:57 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2025-08-19 7:57 UTC (permalink / raw)
To: Nicolas Frattaroli; +Cc: linux-pm
Hello Nicolas Frattaroli,
Commit 32e0d669f3ac ("cpufreq: mediatek-hw: Add support for MT8196")
from Jul 16, 2025 (linux-next), leads to the following Smatch static
checker warning:
drivers/cpufreq/mediatek-cpufreq-hw.c:76 mtk_cpufreq_hw_mt8196_init()
warn: passing zero to 'PTR_ERR'
drivers/cpufreq/mediatek-cpufreq-hw.c
72 static int mtk_cpufreq_hw_mt8196_init(struct mtk_cpufreq_priv *priv)
73 {
74 priv->fdvfs = devm_of_iomap(priv->dev, priv->dev->of_node, 0, NULL);
75 if (IS_ERR_OR_NULL(priv->fdvfs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
devm_of_iomap() can't return NULL.
--> 76 return dev_err_probe(priv->dev, PTR_ERR(priv->fdvfs),
Passing a zero to to dev_err_probe() is a bug. See my blog for more
details:
https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/
77 "failed to get fdvfs iomem\n");
78
79 return 0;
80 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-19 7:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 7:57 [bug report] cpufreq: mediatek-hw: Add support for MT8196 Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox