[openeuler:OLK-6.6 2263/2263] mm/mem_sampling.c:37:6: warning: no previous prototype for function 'mem_sampling_record_cb_register'

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: dea1e68d661266b45b33cc596c34b451de95000c commit: cc5f4f44852f9eb4feb22a40cbb4e3d1b10c36a0 [2263/2263] mm_monitor/mm_spe: Add PMU based memory sampling abstract layer config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250521/202505210722.gwnDsvxy-lkp@i...) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250521/202505210722.gwnDsvxy-lkp@i...) 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 <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202505210722.gwnDsvxy-lkp@intel.com/ All warnings (new ones prefixed by >>):
mm/mem_sampling.c:37:6: warning: no previous prototype for function 'mem_sampling_record_cb_register' [-Wmissing-prototypes] 37 | void mem_sampling_record_cb_register(mem_sampling_record_cb_type cb) | ^ mm/mem_sampling.c:37:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 37 | void mem_sampling_record_cb_register(mem_sampling_record_cb_type cb) | ^ | static mm/mem_sampling.c:54:6: warning: no previous prototype for function 'mem_sampling_record_cb_unregister' [-Wmissing-prototypes] 54 | void mem_sampling_record_cb_unregister(mem_sampling_record_cb_type cb) | ^ mm/mem_sampling.c:54:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 54 | void mem_sampling_record_cb_unregister(mem_sampling_record_cb_type cb) | ^ | static mm/mem_sampling.c:67:6: warning: no previous prototype for function 'mem_sampling_process' [-Wmissing-prototypes] 67 | void mem_sampling_process(void) | ^ mm/mem_sampling.c:67:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 67 | void mem_sampling_process(void) | ^ | static 3 warnings generated.
vim +/mem_sampling_record_cb_register +37 mm/mem_sampling.c 36
37 void mem_sampling_record_cb_register(mem_sampling_record_cb_type cb) 38 { 39 struct mem_sampling_record_cb_list_entry *cb_entry, *tmp; 40 41 list_for_each_entry_safe(cb_entry, tmp, &mem_sampling_record_cb_list, list) { 42 if (cb_entry->cb == cb) 43 return; 44 } 45 46 cb_entry = kmalloc(sizeof(struct mem_sampling_record_cb_list_entry), GFP_KERNEL); 47 if (!cb_entry) 48 return; 49 50 cb_entry->cb = cb; 51 list_add(&(cb_entry->list), &mem_sampling_record_cb_list); 52 } 53 54 void mem_sampling_record_cb_unregister(mem_sampling_record_cb_type cb) 55 { 56 struct mem_sampling_record_cb_list_entry *cb_entry, *tmp; 57 58 list_for_each_entry_safe(cb_entry, tmp, &mem_sampling_record_cb_list, list) { 59 if (cb_entry->cb == cb) { 60 list_del(&cb_entry->list); 61 kfree(cb_entry); 62 return; 63 } 64 } 65 } 66
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot