Skip to contentSkip to conversation

kernel/sched/cputime.c:25:12: error: static declaration of 'sched_clock_irqtime' follows non-static declaration

PATCH In review kernel test robot 3 participants 3 messages Feb 1, 2025 – Feb 4, 2025 Scheduler

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/urgent
head:   efd5bd3144b76ff6eab5443d16df9797d9d7f4cd
commit: efd5bd3144b76ff6eab5443d16df9797d9d7f4cd [2/2] sched: Don't define sched_clock_irqtime as static key
config: arm-randconfig-002-20250201 (https://download.01.org/0day-ci/archive/20250201/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250201/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from kernel/sched/build_policy.c:59:

>> kernel/sched/cputime.c:25:12: error: static declaration of 'sched_clock_irqtime' follows non-static declaration
      25 | static int sched_clock_irqtime;
         |            ^
   kernel/sched/sched.h:3262:12: note: previous declaration is here
    3262 | extern int sched_clock_irqtime;
         |            ^

1 error generated.

vim +/sched_clock_irqtime +25 kernel/sched/cputime.c

    24	
  > 25	static int sched_clock_irqtime;
    26	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw

PATCH 1/1 sched: Fix static declaration of 'sched_clock_irqtime' follows non-static declaration

kernel test robot reported the following error:

All errors (new ones prefixed by >>):

In file included from kernel/sched/build_policy.c:59:

Quoted 1 line
Quoted 1 line

kernel/sched/cputime.c:25:12: error: static declaration of 'sched_clock_irqtime' follows non-static declaration

      25 | static int sched_clock_irqtime;
         |            ^
   kernel/sched/sched.h:3262:12: note: previous declaration is here
    3262 | extern int sched_clock_irqtime;
         |            ^

1 error generated.

vim +/sched_clock_irqtime +25 kernel/sched/cputime.c

    24
Quoted 1 line

25 static int sched_clock_irqtime;

    26
---
 kernel/sched/cputime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/cputime.c +1 -1
index c7904ce2345a..6dab4854c6c0 100644
@@ -22,7 +22,7 @@
  */
 DEFINE_PER_CPU(struct irqtime, cpu_irqtime);
 
-static int sched_clock_irqtime;
+int sched_clock_irqtime;
 
 void enable_sched_clock_irqtime(void)
 {
Signature · 1 line
2.37.1 (Apple Git-137.1)
maintainer
#2 lore raw

Re: [PATCH] sched: Fix static declaration of 'sched_clock_irqtime' follows non-static declaration

Quoted 15 lines · Yafang Shao

kernel test robot reported the following error:

All errors (new ones prefixed by >>):

In file included from kernel/sched/build_policy.c:59:

Quoted 1 line
Quoted 1 line

kernel/sched/cputime.c:25:12: error: static declaration of 'sched_clock_irqtime' follows non-static declaration

      25 | static int sched_clock_irqtime;
         |            ^
   kernel/sched/sched.h:3262:12: note: previous declaration is here
    3262 | extern int sched_clock_irqtime;
         |            ^

1 error generated.

vim +/sched_clock_irqtime +25 kernel/sched/cputime.c

Quoted 7 lines
    24
Quoted 1 line

25 static int sched_clock_irqtime;

    26

Once the build robot complained I dropped the patch. This don't apply to anything.