tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 5df924d19629975d565da37eb7268c7bf4d491fe commit: 3e09dd7690da513de18a1abdabaaf206fd9972e1 [12059/12188] gcov: use kvmalloc() config: powerpc64-randconfig-r031-20210412 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45) 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 powerpc64 cross compiling tool for clang build # apt-get install binutils-powerpc64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3e09dd7690da513de18a1abdabaaf206fd9972e1 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 3e09dd7690da513de18a1abdabaaf206fd9972e1 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All warnings (new ones prefixed by >>): kernel/gcov/clang.c:88:6: warning: no previous prototype for function 'llvm_gcov_init' [-Wmissing-prototypes] void llvm_gcov_init(llvm_gcov_callback writeout, llvm_gcov_callback flush) ^ kernel/gcov/clang.c:88:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void llvm_gcov_init(llvm_gcov_callback writeout, llvm_gcov_callback flush) ^ static kernel/gcov/clang.c:121:6: warning: no previous prototype for function 'llvm_gcda_start_file' [-Wmissing-prototypes] void llvm_gcda_start_file(const char *orig_filename, u32 version, u32 checksum) ^ kernel/gcov/clang.c:121:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void llvm_gcda_start_file(const char *orig_filename, u32 version, u32 checksum) ^ static kernel/gcov/clang.c:150:6: warning: no previous prototype for function 'llvm_gcda_emit_function' [-Wmissing-prototypes] void llvm_gcda_emit_function(u32 ident, u32 func_checksum, u32 cfg_checksum) ^ kernel/gcov/clang.c:150:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void llvm_gcda_emit_function(u32 ident, u32 func_checksum, u32 cfg_checksum) ^ static kernel/gcov/clang.c:166:6: warning: no previous prototype for function 'llvm_gcda_emit_arcs' [-Wmissing-prototypes] void llvm_gcda_emit_arcs(u32 num_counters, u64 *counters) ^ kernel/gcov/clang.c:166:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void llvm_gcda_emit_arcs(u32 num_counters, u64 *counters) ^ static kernel/gcov/clang.c:176:6: warning: no previous prototype for function 'llvm_gcda_summary_info' [-Wmissing-prototypes] void llvm_gcda_summary_info(void) ^ kernel/gcov/clang.c:176:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void llvm_gcda_summary_info(void) ^ static kernel/gcov/clang.c:181:6: warning: no previous prototype for function 'llvm_gcda_end_file' [-Wmissing-prototypes] void llvm_gcda_end_file(void) ^ kernel/gcov/clang.c:181:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void llvm_gcda_end_file(void) ^ static kernel/gcov/clang.c:371:21: error: implicit declaration of function 'vmalloc' [-Werror,-Wimplicit-function-declaration] fn_dup->counters = vmalloc(cv_size); ^ >> kernel/gcov/clang.c:371:19: warning: incompatible integer to pointer conversion assigning to 'u64 *' (aka 'unsigned long long *') from 'int' [-Wint-conversion] fn_dup->counters = vmalloc(cv_size); ^ ~~~~~~~~~~~~~~~~ 7 warnings and 1 error generated. vim +371 kernel/gcov/clang.c e178a5beb36960 Greg Hackmann 2019-05-14 331 60bcf728ee7c60 Nick Desaulniers 2021-03-24 332 #if CONFIG_CLANG_VERSION < 110000 e178a5beb36960 Greg Hackmann 2019-05-14 333 static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn) e178a5beb36960 Greg Hackmann 2019-05-14 334 { e178a5beb36960 Greg Hackmann 2019-05-14 335 size_t cv_size; /* counter values size */ 3e09dd7690da51 Johannes Berg 2021-04-12 336 struct gcov_fn_info *fn_dup = kmemdup(fn, sizeof(*fn), GFP_KERNEL); 3e09dd7690da51 Johannes Berg 2021-04-12 337 e178a5beb36960 Greg Hackmann 2019-05-14 338 if (!fn_dup) e178a5beb36960 Greg Hackmann 2019-05-14 339 return NULL; e178a5beb36960 Greg Hackmann 2019-05-14 340 INIT_LIST_HEAD(&fn_dup->head); e178a5beb36960 Greg Hackmann 2019-05-14 341 e178a5beb36960 Greg Hackmann 2019-05-14 342 fn_dup->function_name = kstrdup(fn->function_name, GFP_KERNEL); e178a5beb36960 Greg Hackmann 2019-05-14 343 if (!fn_dup->function_name) e178a5beb36960 Greg Hackmann 2019-05-14 344 goto err_name; e178a5beb36960 Greg Hackmann 2019-05-14 345 e178a5beb36960 Greg Hackmann 2019-05-14 346 cv_size = fn->num_counters * sizeof(fn->counters[0]); 3e09dd7690da51 Johannes Berg 2021-04-12 347 fn_dup->counters = kvmalloc(cv_size, GFP_KERNEL); e178a5beb36960 Greg Hackmann 2019-05-14 348 if (!fn_dup->counters) e178a5beb36960 Greg Hackmann 2019-05-14 349 goto err_counters; e178a5beb36960 Greg Hackmann 2019-05-14 350 memcpy(fn_dup->counters, fn->counters, cv_size); e178a5beb36960 Greg Hackmann 2019-05-14 351 e178a5beb36960 Greg Hackmann 2019-05-14 352 return fn_dup; e178a5beb36960 Greg Hackmann 2019-05-14 353 e178a5beb36960 Greg Hackmann 2019-05-14 354 err_counters: e178a5beb36960 Greg Hackmann 2019-05-14 355 kfree(fn_dup->function_name); e178a5beb36960 Greg Hackmann 2019-05-14 356 err_name: e178a5beb36960 Greg Hackmann 2019-05-14 357 kfree(fn_dup); e178a5beb36960 Greg Hackmann 2019-05-14 358 return NULL; e178a5beb36960 Greg Hackmann 2019-05-14 359 } 60bcf728ee7c60 Nick Desaulniers 2021-03-24 360 #else 60bcf728ee7c60 Nick Desaulniers 2021-03-24 361 static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn) 60bcf728ee7c60 Nick Desaulniers 2021-03-24 362 { 60bcf728ee7c60 Nick Desaulniers 2021-03-24 363 size_t cv_size; /* counter values size */ 60bcf728ee7c60 Nick Desaulniers 2021-03-24 364 struct gcov_fn_info *fn_dup = kmemdup(fn, sizeof(*fn), 60bcf728ee7c60 Nick Desaulniers 2021-03-24 365 GFP_KERNEL); 60bcf728ee7c60 Nick Desaulniers 2021-03-24 366 if (!fn_dup) 60bcf728ee7c60 Nick Desaulniers 2021-03-24 367 return NULL; 60bcf728ee7c60 Nick Desaulniers 2021-03-24 368 INIT_LIST_HEAD(&fn_dup->head); 60bcf728ee7c60 Nick Desaulniers 2021-03-24 369 60bcf728ee7c60 Nick Desaulniers 2021-03-24 370 cv_size = fn->num_counters * sizeof(fn->counters[0]); 60bcf728ee7c60 Nick Desaulniers 2021-03-24 @371 fn_dup->counters = vmalloc(cv_size); 60bcf728ee7c60 Nick Desaulniers 2021-03-24 372 if (!fn_dup->counters) { 60bcf728ee7c60 Nick Desaulniers 2021-03-24 373 kfree(fn_dup); 60bcf728ee7c60 Nick Desaulniers 2021-03-24 374 return NULL; 60bcf728ee7c60 Nick Desaulniers 2021-03-24 375 } 60bcf728ee7c60 Nick Desaulniers 2021-03-24 376 60bcf728ee7c60 Nick Desaulniers 2021-03-24 377 memcpy(fn_dup->counters, fn->counters, cv_size); 60bcf728ee7c60 Nick Desaulniers 2021-03-24 378 60bcf728ee7c60 Nick Desaulniers 2021-03-24 379 return fn_dup; 60bcf728ee7c60 Nick Desaulniers 2021-03-24 380 } 60bcf728ee7c60 Nick Desaulniers 2021-03-24 381 #endif e178a5beb36960 Greg Hackmann 2019-05-14 382 :::::: The code at line 371 was first introduced by commit :::::: 60bcf728ee7c60ac2a1f9a0eaceb3a7b3954cd2b gcov: fix clang-11+ support :::::: TO: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip