Skip to contentSkip to conversation

kernel/sched/core.c:123:6: warning: no previous prototype for 'sched_core_get'

PATCH Joel Fernandes 1 participant 2 messages Nov 24, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core-sched
head:   7b55b5ef19fbadf111b8d60d320437bfc0467a79
commit: 636f9841873bff3684ee81155804b796d58408a4 [4/12] sched: Core-wide rq->lock
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=636f9841873bff3684ee81155804b796d58408a4
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/core-sched
git checkout 636f9841873bff3684ee81155804b796d58408a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/sched/core.c:123:6: warning: no previous prototype for 'sched_core_get' [-Wmissing-prototypes]

Quoted 8 lines
     123 | void sched_core_get(void)
         |      ^~~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

kernel/sched/core.c:131:6: warning: no previous prototype for 'sched_core_put' [-Wmissing-prototypes]

     131 | void sched_core_put(void)
         |      ^~~~~~~~~~~~~~

kernel/sched/core.c:2900:6: warning: no previous prototype for 'sched_set_stop_task' [-Wmissing-prototypes]
2900 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~

At least this sched_set_stop_task one is not a recently introduced warning.

This prototype warning does seem bogus though. Do we fix it? Obvious quick fix is the declar sched_core_{get,put}() in sched.h to pacify the compiler.

thanks,

- Joel

#2 lore raw
Quoted 31 lines · Joel Fernandes
Quoted 21 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core-sched
head:   7b55b5ef19fbadf111b8d60d320437bfc0467a79
commit: 636f9841873bff3684ee81155804b796d58408a4 [4/12] sched: Core-wide rq->lock
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=636f9841873bff3684ee81155804b796d58408a4
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/core-sched
git checkout 636f9841873bff3684ee81155804b796d58408a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/sched/core.c:123:6: warning: no previous prototype for 'sched_core_get' [-Wmissing-prototypes]

Quoted 8 lines
     123 | void sched_core_get(void)
         |      ^~~~~~~~~~~~~~
Quoted 1 line
Quoted 1 line

kernel/sched/core.c:131:6: warning: no previous prototype for 'sched_core_put' [-Wmissing-prototypes]

     131 | void sched_core_put(void)
         |      ^~~~~~~~~~~~~~

kernel/sched/core.c:2900:6: warning: no previous prototype for 'sched_set_stop_task' [-Wmissing-prototypes]
2900 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~

Quoted 4 lines

At least this sched_set_stop_task one is not a recently introduced warning.

This prototype warning does seem bogus though. Do we fix it? Obvious quick fix is the declar sched_core_{get,put}() in sched.h to pacify the compiler.

BTW, I did add it to my tree already in:
93de21e503a3 ("sched: Move core-scheduler interfacing code to a new file")
https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git/log/?h=coresched

Until the interface patches are in, we could define sched_core_get/put with "__maybe_unused static" to silence the warnings.

thanks,

- Joel