[arm-platforms:hack/ppi 25/25] kernel/irq/manage.c:2453:5: warning: no previous prototype for function 'add_percpu_irq_target'

kernel test robot lkp at intel.com
Thu Jul 31 21:34:36 PDT 2025


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git hack/ppi
head:   8a3b504aca25e8c9a274cb563d63a6b9454b2780
commit: 8a3b504aca25e8c9a274cb563d63a6b9454b2780 [25/25] WIP
config: i386-buildonly-randconfig-001-20250801 (https://download.01.org/0day-ci/archive/20250801/202508011211.XM88eJmr-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250801/202508011211.XM88eJmr-lkp@intel.com/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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508011211.XM88eJmr-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/irq/manage.c:2466:27: error: incompatible pointer types initializing 'struct irq_action *' with an expression of type 'struct irqaction **' [-Werror,-Wincompatible-pointer-types]
    2466 |                 for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next) {
         |                                         ^     ~~~~~~~~~~~~~
   kernel/irq/manage.c:2466:62: error: incomplete definition of type 'struct irq_action'
    2466 |                 for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next) {
         |                                                                         ~~~^
   kernel/irq/manage.c:2461:10: note: forward declaration of 'struct irq_action'
    2461 |                 struct irq_action *action = NULL;
         |                        ^
   kernel/irq/manage.c:2467:48: error: incomplete definition of type 'struct irq_action'
    2467 |                         if (cpumask_test_cpu(smp_processor_id(), tmp->affinity))
         |                                                                  ~~~^
   kernel/irq/manage.c:2461:10: note: forward declaration of 'struct irq_action'
    2461 |                 struct irq_action *action = NULL;
         |                        ^
   kernel/irq/manage.c:2470:11: error: incomplete definition of type 'struct irq_action'
    2470 |                         if (tmp->percpu_dev_id == dev_id)
         |                             ~~~^
   kernel/irq/manage.c:2461:10: note: forward declaration of 'struct irq_action'
    2461 |                 struct irq_action *action = NULL;
         |                        ^
   kernel/irq/manage.c:2474:45: error: incomplete definition of type 'struct irq_action'
    2474 |                 cpumask_set_cpu(smp_processor_id(), action->affinity);
         |                                                     ~~~~~~^
   kernel/irq/manage.c:2461:10: note: forward declaration of 'struct irq_action'
    2461 |                 struct irq_action *action = NULL;
         |                        ^
   kernel/irq/manage.c:2477:28: error: incomplete definition of type 'struct irq_action'
    2477 |                 if (cpumask_weight(action->affinity) == nr_possible_cpus())
         |                                    ~~~~~~^
   kernel/irq/manage.c:2461:10: note: forward declaration of 'struct irq_action'
    2461 |                 struct irq_action *action = NULL;
         |                        ^
   kernel/irq/manage.c:2477:43: error: call to undeclared function 'nr_possible_cpus'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    2477 |                 if (cpumask_weight(action->affinity) == nr_possible_cpus())
         |                                                         ^
   kernel/irq/manage.c:2478:10: error: incomplete definition of type 'struct irq_action'
    2478 |                         action->flags &= ~IRQF_SHARED;
         |                         ~~~~~~^
   kernel/irq/manage.c:2461:10: note: forward declaration of 'struct irq_action'
    2461 |                 struct irq_action *action = NULL;
         |                        ^
>> kernel/irq/manage.c:2453:5: warning: no previous prototype for function 'add_percpu_irq_target' [-Wmissing-prototypes]
    2453 | int add_percpu_irq_target(unsigned int irq, void __percpu *dev_id)
         |     ^
   kernel/irq/manage.c:2453:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    2453 | int add_percpu_irq_target(unsigned int irq, void __percpu *dev_id)
         | ^
         | static 
   kernel/irq/manage.c:2495:27: error: incompatible pointer types initializing 'struct irq_action *' with an expression of type 'struct irqaction **' [-Werror,-Wincompatible-pointer-types]
    2495 |                 for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next)
         |                                         ^     ~~~~~~~~~~~~~
   kernel/irq/manage.c:2495:62: error: incomplete definition of type 'struct irq_action'
    2495 |                 for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next)
         |                                                                         ~~~^
   kernel/irq/manage.c:2495:15: note: forward declaration of 'struct irq_action'
    2495 |                 for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next)
         |                             ^
   kernel/irq/manage.c:2496:58: error: incomplete definition of type 'struct irq_action'
    2496 |                         if (cpumask_test_and_clear_cpu(smp_processor_id(), tmp->affinity)) {
         |                                                                            ~~~^
   kernel/irq/manage.c:2495:15: note: forward declaration of 'struct irq_action'
    2495 |                 for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next)
         |                             ^
   kernel/irq/manage.c:2497:44: error: call to undeclared function 'nr_possible_cpus'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    2497 |                                 if (cpumask_weight(action->affinity) < nr_possible_cpus())
         |                                                                        ^
   kernel/irq/manage.c:2497:24: error: use of undeclared identifier 'action'
    2497 |                                 if (cpumask_weight(action->affinity) < nr_possible_cpus())
         |                                                    ^
   kernel/irq/manage.c:2498:6: error: use of undeclared identifier 'action'
    2498 |                                         action->flags |= IRQF_SHARED;
         |                                         ^
>> kernel/irq/manage.c:2484:5: warning: no previous prototype for function 'remove_percpu_irq_target' [-Wmissing-prototypes]
    2484 | int remove_percpu_irq_target(unsigned int irq)
         |     ^
   kernel/irq/manage.c:2484:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    2484 | int remove_percpu_irq_target(unsigned int irq)
         | ^
         | static 
   2 warnings and 14 errors generated.


vim +/add_percpu_irq_target +2453 kernel/irq/manage.c

  2452	
> 2453	int add_percpu_irq_target(unsigned int irq, void __percpu *dev_id)
  2454	{
  2455		struct irq_desc *desc = irq_to_desc(irq);
  2456	
  2457		if (!desc || !irq_settings_is_per_cpu_devid(desc))
  2458			return -EINVAL;
  2459	
  2460		scoped_guard(raw_spinlock_irqsave, &desc->lock) {
  2461			struct irq_action *action = NULL;
  2462	
  2463			if (cpumask_test_cpu(smp_processor_id(), desc->percpu_enabled))
  2464				return -EINVAL;
  2465	
  2466			for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next) {
  2467				if (cpumask_test_cpu(smp_processor_id(), tmp->affinity))
  2468					return -EINVAL;
  2469	
  2470				if (tmp->percpu_dev_id == dev_id)
  2471					action = tmp;
  2472			}
  2473	
  2474			cpumask_set_cpu(smp_processor_id(), action->affinity);
  2475	
  2476			/* If we have a full house, indicate we can't share anymore */
> 2477			if (cpumask_weight(action->affinity) == nr_possible_cpus())
  2478				action->flags &= ~IRQF_SHARED;
  2479		}
  2480	
  2481		return 0;
  2482	}
  2483	
> 2484	int remove_percpu_irq_target(unsigned int irq)
  2485	{
  2486		struct irq_desc *desc = irq_to_desc(irq);
  2487	
  2488		if (!desc || !irq_settings_is_per_cpu_devid(desc))
  2489			return -EINVAL;
  2490	
  2491		scoped_guard(raw_spinlock_irqsave, &desc->lock) {
  2492			if (cpumask_test_cpu(smp_processor_id(), desc->percpu_enabled))
  2493				return -EINVAL;
  2494	
  2495			for (struct irq_action *tmp = &desc->action; tmp; tmp = tmp->next)
  2496				if (cpumask_test_and_clear_cpu(smp_processor_id(), tmp->affinity)) {
> 2497					if (cpumask_weight(action->affinity) < nr_possible_cpus())
  2498						action->flags |= IRQF_SHARED;
  2499	
  2500					return 0;
  2501				}
  2502		}
  2503	
  2504		return -ENOENT;
  2505	}
  2506	

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



More information about the linux-arm-kernel mailing list