drivers/cpufreq/armada-8k-cpufreq.c:53:40: sparse: sparse: Using plain integer as NULL pointer

From: kernel test robot
Date: Thu Dec 14 2023 - 03:31:45 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd
commit: f525a670533d961fd72ab748e3aac002d7b3d1b9 cpufreq: ap806: add cpufreq driver for Armada 8K
date: 4 years, 10 months ago
config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231214/202312141651.lCAXGAZ2-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231214/202312141651.lCAXGAZ2-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312141651.lCAXGAZ2-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/cpufreq/armada-8k-cpufreq.c:53:40: sparse: sparse: Using plain integer as NULL pointer
drivers/cpufreq/armada-8k-cpufreq.c:155:40: sparse: sparse: Using plain integer as NULL pointer

vim +53 drivers/cpufreq/armada-8k-cpufreq.c

36
37 /* If the CPUs share the same clock, then they are in the same cluster. */
38 static void __init armada_8k_get_sharing_cpus(struct clk *cur_clk,
39 struct cpumask *cpumask)
40 {
41 int cpu;
42
43 for_each_possible_cpu(cpu) {
44 struct device *cpu_dev;
45 struct clk *clk;
46
47 cpu_dev = get_cpu_device(cpu);
48 if (!cpu_dev) {
49 pr_warn("Failed to get cpu%d device\n", cpu);
50 continue;
51 }
52
> 53 clk = clk_get(cpu_dev, 0);
54 if (IS_ERR(clk)) {
55 pr_warn("Cannot get clock for CPU %d\n", cpu);
56 } else {
57 if (clk_is_match(clk, cur_clk))
58 cpumask_set_cpu(cpu, cpumask);
59
60 clk_put(clk);
61 }
62 }
63 }
64

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki