[openeuler:OLK-6.6 2909/2909] mm/mem_sampling.c:35:1: sparse: sparse: symbol 'mem_sampling_record_cb_list' was not declared. Should it be static?

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: a159deb279dfe156316d8c3957dc7f253686ff83 commit: cc5f4f44852f9eb4feb22a40cbb4e3d1b10c36a0 [2909/2909] mm_monitor/mm_spe: Add PMU based memory sampling abstract layer config: arm64-randconfig-r121-20250923 (https://download.01.org/0day-ci/archive/20250923/202509231035.kkQxDq6u-lkp@i...) compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250923/202509231035.kkQxDq6u-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/202509231035.kkQxDq6u-lkp@intel.com/ sparse warnings: (new ones prefixed by >>)
mm/mem_sampling.c:35:1: sparse: sparse: symbol 'mem_sampling_record_cb_list' was not declared. Should it be static? mm/mem_sampling.c:37:6: sparse: sparse: symbol 'mem_sampling_record_cb_register' was not declared. Should it be static? mm/mem_sampling.c:54:6: sparse: sparse: symbol 'mem_sampling_record_cb_unregister' was not declared. Should it be static? mm/mem_sampling.c:67:6: sparse: sparse: symbol 'mem_sampling_process' was not declared. Should it be static?
vim +/mem_sampling_record_cb_list +35 mm/mem_sampling.c 30 31 struct mem_sampling_record_cb_list_entry { 32 struct list_head list; 33 mem_sampling_record_cb_type cb; 34 };
35 LIST_HEAD(mem_sampling_record_cb_list); 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