Re: [PATCH 2/5] sparc/irq: Remove on-stack cpumask var

From: kernel test robot
Date: Thu Apr 18 2024 - 20:20:48 EST


Hi Dawei,

kernel test robot noticed the following build warnings:

[auto build test WARNING on v6.9-rc4]
[also build test WARNING on linus/master next-20240418]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Dawei-Li/sparc-srmmu-Remove-on-stack-cpumask-var/20240418-185348
base: v6.9-rc4
patch link: https://lore.kernel.org/r/20240418104949.3606645-3-dawei.li%40shingroup.cn
patch subject: [PATCH 2/5] sparc/irq: Remove on-stack cpumask var
config: sparc64-defconfig (https://download.01.org/0day-ci/archive/20240419/202404190826.Zi1J5nCx-lkp@xxxxxxxxx/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240419/202404190826.Zi1J5nCx-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/202404190826.Zi1J5nCx-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

arch/sparc/kernel/irq_64.c: In function 'irq_choose_cpu':
>> arch/sparc/kernel/irq_64.c:358:46: warning: the omitted middle operand in '?:' will always be 'true', suggest explicit middle operand [-Wparentheses]
358 | cpuid = cpuid < nr_cpu_ids ? : map_to_cpu(irq);
| ^


vim +358 arch/sparc/kernel/irq_64.c

348
349 #ifdef CONFIG_SMP
350 static int irq_choose_cpu(unsigned int irq, const struct cpumask *affinity)
351 {
352 int cpuid;
353
354 if (cpumask_equal(affinity, cpu_online_mask)) {
355 cpuid = map_to_cpu(irq);
356 } else {
357 cpuid = cpumask_first_and(affinity, cpu_online_mask);
> 358 cpuid = cpuid < nr_cpu_ids ? : map_to_cpu(irq);
359 }
360
361 return cpuid;
362 }
363 #else
364 #define irq_choose_cpu(irq, affinity) \
365 real_hard_smp_processor_id()
366 #endif
367

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