[alibaba-cloud:linux-next 11093/12249] fs/proc/stat.c:48:5: warning: no previous prototype for function 'get_idle_time'
开放中
[alibaba-cloud:linux-next 11093/12249] fs/proc/stat.c:48:5: warning: no previous prototype for function 'get_idle_time'
Hi Xunlei,
FYI, the error/warning still remains.
tree: https://github.com/alibaba/cloud-kernel.git linux-next
head: c3ac3c331d6cc495be9603404799c061d71af44c
commit: 9be0ac2bcbaa1831196a88f5e81ea162811f3418 [11093/12249] alinux: cpuacct: export cpuacct.proc_stat interface
config: x86_64-randconfig-a005-20200927 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6d374cf78c8a80a0bbfc7ce9bc80b3f183f44c80)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/alibaba/cloud-kernel/commit/9be0ac2bcbaa1831196a88f5e81ea162811f3418
git remote add alibaba-cloud https://github.com/alibaba/cloud-kernel.git
git fetch --no-tags alibaba-cloud linux-next
git checkout 9be0ac2bcbaa1831196a88f5e81ea162811f3418
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> fs/proc/stat.c:48:5: warning: no previous prototype for function 'get_idle_time' [-Wmissing-prototypes]
u64 get_idle_time(int cpu)
^
fs/proc/stat.c:48:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u64 get_idle_time(int cpu)
^
static
>> fs/proc/stat.c:64:5: warning: no previous prototype for function 'get_iowait_time' [-Wmissing-prototypes]
u64 get_iowait_time(int cpu)
^
fs/proc/stat.c:64:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u64 get_iowait_time(int cpu)
^
static
2 warnings generated.
vim +/get_idle_time +48 fs/proc/stat.c
47
> 48 u64 get_idle_time(int cpu)
49 {
50 u64 idle, idle_usecs = -1ULL;
51
52 if (cpu_online(cpu))
53 idle_usecs = get_cpu_idle_time_us(cpu, NULL);
54
55 if (idle_usecs == -1ULL)
56 /* !NO_HZ or cpu offline so we can rely on cpustat.idle */
57 idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE];
58 else
59 idle = idle_usecs * NSEC_PER_USEC;
60
61 return idle;
62 }
63
> 64 u64 get_iowait_time(int cpu)
65 {
66 u64 iowait, iowait_usecs = -1ULL;
67
68 if (cpu_online(cpu))
69 iowait_usecs = get_cpu_iowait_time_us(cpu, NULL);
70
71 if (iowait_usecs == -1ULL)
72 /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */
73 iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT];
74 else
75 iowait = iowait_usecs * NSEC_PER_USEC;
76
77 return iowait;
78 }
79
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
请注册或登录再回复