From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1377871082064306830==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [zen:5.16/prjc 58/262] kernel/sched/alt_core.c:1528:6: warning: no previous prototype for function 'sched_set_stop_task' Date: Mon, 31 Jan 2022 13:06:50 +0800 Message-ID: <202201311343.ePwmfORe-lkp@intel.com> List-Id: --===============1377871082064306830== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://github.com/zen-kernel/zen-kernel 5.16/prjc head: afc445ebe063a19bcb9288bb90a35b4a57c445b0 commit: 505879af5d96055f5670272c56d75f6994971567 [58/262] sched/alt: Fix co= mpilation erro in pelt.c config: x86_64-randconfig-a011-20220131 (https://download.01.org/0day-ci/ar= chive/20220131/202201311343.ePwmfORe-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2cdbac= a3943a4d6259119f185656328bd3805b68) reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/zen-kernel/zen-kernel/commit/505879af5d96055f5= 670272c56d75f6994971567 git remote add zen https://github.com/zen-kernel/zen-kernel git fetch --no-tags zen 5.16/prjc git checkout 505879af5d96055f5670272c56d75f6994971567 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Dx86_64 SHELL=3D/bin/bash kernel/sched/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): ^~~~~~~~~ include/linux/compiler_types.h:323:23: note: expanded from macro '_compi= letime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^~~~~~~~~ include/linux/compiler_types.h:315:9: note: expanded from macro '__compi= letime_assert' if (!(condition)) \ ^~~~~~~~~ kernel/sched/alt_core.c:1100:16: error: no member named 'cpu' in 'struct= task_struct' WRITE_ONCE(p->cpu, cpu); ~ ^ include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONC= E' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:303:10: note: expanded from macro '__nati= ve_word' sizeof(t) =3D=3D sizeof(int) || sizeof(t) =3D=3D sizeof(long)) ^ include/linux/compiler_types.h:335:22: note: expanded from macro 'compil= etime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COU= NTER__) ^~~~~~~~~ include/linux/compiler_types.h:323:23: note: expanded from macro '_compi= letime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^~~~~~~~~ include/linux/compiler_types.h:315:9: note: expanded from macro '__compi= letime_assert' if (!(condition)) \ ^~~~~~~~~ kernel/sched/alt_core.c:1100:16: error: no member named 'cpu' in 'struct= task_struct' WRITE_ONCE(p->cpu, cpu); ~ ^ include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONC= E' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:303:38: note: expanded from macro '__nati= ve_word' sizeof(t) =3D=3D sizeof(int) || sizeof(t) =3D=3D sizeof(long)) ^ include/linux/compiler_types.h:335:22: note: expanded from macro 'compil= etime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COU= NTER__) ^~~~~~~~~ include/linux/compiler_types.h:323:23: note: expanded from macro '_compi= letime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^~~~~~~~~ include/linux/compiler_types.h:315:9: note: expanded from macro '__compi= letime_assert' if (!(condition)) \ ^~~~~~~~~ kernel/sched/alt_core.c:1100:16: error: no member named 'cpu' in 'struct= task_struct' WRITE_ONCE(p->cpu, cpu); ~ ^ include/asm-generic/rwonce.h:60:33: note: expanded from macro 'WRITE_ONC= E' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:48: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:335:22: note: expanded from macro 'compil= etime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COU= NTER__) ^~~~~~~~~ include/linux/compiler_types.h:323:23: note: expanded from macro '_compi= letime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^~~~~~~~~ include/linux/compiler_types.h:315:9: note: expanded from macro '__compi= letime_assert' if (!(condition)) \ ^~~~~~~~~ kernel/sched/alt_core.c:1100:16: error: no member named 'cpu' in 'struct= task_struct' WRITE_ONCE(p->cpu, cpu); ~ ^ include/asm-generic/rwonce.h:61:15: note: expanded from macro 'WRITE_ONC= E' __WRITE_ONCE(x, val); \ ^ include/asm-generic/rwonce.h:55:20: note: expanded from macro '__WRITE_O= NCE' *(volatile typeof(x) *)&(x) =3D (val); = \ ^ kernel/sched/alt_core.c:1100:16: error: no member named 'cpu' in 'struct= task_struct' WRITE_ONCE(p->cpu, cpu); ~ ^ include/asm-generic/rwonce.h:61:15: note: expanded from macro 'WRITE_ONC= E' __WRITE_ONCE(x, val); \ ^ include/asm-generic/rwonce.h:55:27: note: expanded from macro '__WRITE_O= NCE' *(volatile typeof(x) *)&(x) =3D (val); = \ ^ kernel/sched/alt_core.c:1307:15: error: conflicting types for 'wait_task= _inactive' unsigned long wait_task_inactive(struct task_struct *p, long match_state) ^ include/linux/sched.h:1980:22: note: previous declaration is here extern unsigned long wait_task_inactive(struct task_struct *, unsigned i= nt match_state); ^ kernel/sched/alt_core.c:1330:35: error: no member named 'state' in 'stru= ct task_struct' if (match_state && unlikely(p->state !=3D match_= state)) ~ ^ include/linux/compiler.h:78:42: note: expanded from macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ kernel/sched/alt_core.c:1345:26: error: no member named 'state' in 'stru= ct task_struct' if (!match_state || p->state =3D=3D match_state) ~ ^ >> kernel/sched/alt_core.c:1528:6: warning: no previous prototype for funct= ion 'sched_set_stop_task' [-Wmissing-prototypes] void sched_set_stop_task(int cpu, struct task_struct *stop) ^ kernel/sched/alt_core.c:1528:1: note: declare 'static' if the function i= s not intended to be used outside of this translation unit void sched_set_stop_task(int cpu, struct task_struct *stop) ^ static = kernel/sched/alt_core.c:1620:28: error: no member named 'state' in 'stru= ct task_struct' if (task_running(p) || p->state =3D=3D TASK_WAKING) { ~ ^ kernel/sched/alt_core.c:1698:5: error: no member named 'state' in 'struc= t task_struct' p->state =3D TASK_RUNNING; ~ ^ kernel/sched/alt_core.c:2047:12: error: no member named 'state' in 'stru= ct task_struct'; did you mean 'stime'? if (!(p->state & state)) ^~~~~ stime include/linux/sched.h:1022:9: note: 'stime' declared here u64 stime; ^ kernel/sched/alt_core.c:2052:6: error: no member named 'state' in 'struc= t task_struct' p->state =3D TASK_RUNNING; ~ ^ fatal error: too many errors emitted, stopping now [-ferror-limit=3D] 4 warnings and 20 errors generated. vim +/sched_set_stop_task +1528 kernel/sched/alt_core.c 1d7e12db7a510f Alfred Chen 2019-08-19 1527 = 1d7e12db7a510f Alfred Chen 2019-08-19 @1528 void sched_set_stop_task(int c= pu, struct task_struct *stop) 1d7e12db7a510f Alfred Chen 2019-08-19 1529 { 1d7e12db7a510f Alfred Chen 2019-08-19 1530 struct sched_param stop_param= =3D { .sched_priority =3D STOP_PRIO }; 1d7e12db7a510f Alfred Chen 2019-08-19 1531 struct sched_param start_para= m =3D { .sched_priority =3D 0 }; 1d7e12db7a510f Alfred Chen 2019-08-19 1532 struct task_struct *old_stop = =3D cpu_rq(cpu)->stop; 1d7e12db7a510f Alfred Chen 2019-08-19 1533 = 1d7e12db7a510f Alfred Chen 2019-08-19 1534 if (stop) { 1d7e12db7a510f Alfred Chen 2019-08-19 1535 /* 1d7e12db7a510f Alfred Chen 2019-08-19 1536 * Make it appear like a SCH= ED_FIFO task, its something 1d7e12db7a510f Alfred Chen 2019-08-19 1537 * userspace knows about and= won't get confused about. 1d7e12db7a510f Alfred Chen 2019-08-19 1538 * 1d7e12db7a510f Alfred Chen 2019-08-19 1539 * Also, it will make PI mor= e or less work without too 1d7e12db7a510f Alfred Chen 2019-08-19 1540 * much confusion -- but the= n, stop work should not 1d7e12db7a510f Alfred Chen 2019-08-19 1541 * rely on PI working anyway. 1d7e12db7a510f Alfred Chen 2019-08-19 1542 */ 1d7e12db7a510f Alfred Chen 2019-08-19 1543 sched_setscheduler_nocheck(s= top, SCHED_FIFO, &stop_param); 1d7e12db7a510f Alfred Chen 2019-08-19 1544 } 1d7e12db7a510f Alfred Chen 2019-08-19 1545 = 1d7e12db7a510f Alfred Chen 2019-08-19 1546 cpu_rq(cpu)->stop =3D stop; 1d7e12db7a510f Alfred Chen 2019-08-19 1547 = 1d7e12db7a510f Alfred Chen 2019-08-19 1548 if (old_stop) { 1d7e12db7a510f Alfred Chen 2019-08-19 1549 /* 1d7e12db7a510f Alfred Chen 2019-08-19 1550 * Reset it back to a normal= scheduling policy so that 1d7e12db7a510f Alfred Chen 2019-08-19 1551 * it can die in pieces. 1d7e12db7a510f Alfred Chen 2019-08-19 1552 */ 1d7e12db7a510f Alfred Chen 2019-08-19 1553 sched_setscheduler_nocheck(o= ld_stop, SCHED_NORMAL, &start_param); 1d7e12db7a510f Alfred Chen 2019-08-19 1554 } 1d7e12db7a510f Alfred Chen 2019-08-19 1555 } 1d7e12db7a510f Alfred Chen 2019-08-19 1556 = :::::: The code at line 1528 was first introduced by commit :::::: 1d7e12db7a510fe6b80d8a6450c919b07db1cf76 Project C v5.7.5-r2 :::::: TO: Alfred Chen :::::: CC: Torge Matthies --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============1377871082064306830==--