* [openeuler:OLK-6.6 2380/2380] mm/mem_sampling.c:35:18: warning: unused variable 'mem_sampling_min_value'
@ 2025-06-10 2:18 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-06-10 2:18 UTC (permalink / raw)
To: kernel, Ze Zuo; +Cc: oe-kbuild-all
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: a7f4bf73c34996ee6cdda292e8f906a9c30879de
commit: 390982f28c5796a1e590381044630b768e6b9696 [2380/2380] mm/mem_sampling: Add sysctl control for NUMA balancing integration
config: arm64-randconfig-r112-20250610 (https://download.01.org/0day-ci/archive/20250610/202506101037.VkwcnAFd-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce: (https://download.01.org/0day-ci/archive/20250610/202506101037.VkwcnAFd-lkp@intel.com/reproduce)
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/202506101037.VkwcnAFd-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/mem_sampling.c:68:6: warning: no previous prototype for function 'mem_sampling_record_cb_register' [-Wmissing-prototypes]
68 | void mem_sampling_record_cb_register(mem_sampling_record_cb_type cb)
| ^
mm/mem_sampling.c:68:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
68 | void mem_sampling_record_cb_register(mem_sampling_record_cb_type cb)
| ^
| static
mm/mem_sampling.c:85:6: warning: no previous prototype for function 'mem_sampling_record_cb_unregister' [-Wmissing-prototypes]
85 | void mem_sampling_record_cb_unregister(mem_sampling_record_cb_type cb)
| ^
mm/mem_sampling.c:85:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
85 | void mem_sampling_record_cb_unregister(mem_sampling_record_cb_type cb)
| ^
| static
>> mm/mem_sampling.c:35:18: warning: unused variable 'mem_sampling_min_value' [-Wunused-const-variable]
35 | static const int mem_sampling_min_value = MEM_SAMPLING_MIN_VALUE;
| ^~~~~~~~~~~~~~~~~~~~~~
>> mm/mem_sampling.c:36:18: warning: unused variable 'mem_sampling_max_value' [-Wunused-const-variable]
36 | static const int mem_sampling_max_value = MEM_SAMPLING_MAX_VALUE;
| ^~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
vim +/mem_sampling_min_value +35 mm/mem_sampling.c
34
> 35 static const int mem_sampling_min_value = MEM_SAMPLING_MIN_VALUE;
> 36 static const int mem_sampling_max_value = MEM_SAMPLING_MAX_VALUE;
37
38 /* keep track of who use the SPE */
39 DEFINE_PER_CPU(enum arm_spe_user_e, arm_spe_user);
40 EXPORT_PER_CPU_SYMBOL_GPL(arm_spe_user);
41
42 enum mem_sampling_saved_state_e {
43 MEM_SAMPLING_STATE_ENABLE,
44 MEM_SAMPLING_STATE_DISABLE,
45 MEM_SAMPLING_STATE_EMPTY,
46 };
47 enum mem_sampling_saved_state_e mem_sampling_saved_state = MEM_SAMPLING_STATE_EMPTY;
48
49 /*
50 * Callbacks should be registered using mem_sampling_record_cb_register()
51 * by NUMA, DAMON and etc during their initialisation.
52 * Callbacks will be invoked on new hardware pmu records caputured.
53 */
54 typedef void (*mem_sampling_record_cb_type)(struct mem_sampling_record *record);
55
56 struct mem_sampling_record_cb_list_entry {
57 struct list_head list;
58 mem_sampling_record_cb_type cb;
59 };
60 LIST_HEAD(mem_sampling_record_cb_list);
61
62 struct mem_sampling_numa_access_work {
63 struct callback_head work;
64 u64 vaddr, paddr;
65 int cpu;
66 };
67
68 void mem_sampling_record_cb_register(mem_sampling_record_cb_type cb)
69 {
70 struct mem_sampling_record_cb_list_entry *cb_entry, *tmp;
71
72 list_for_each_entry_safe(cb_entry, tmp, &mem_sampling_record_cb_list, list) {
73 if (cb_entry->cb == cb)
74 return;
75 }
76
77 cb_entry = kmalloc(sizeof(struct mem_sampling_record_cb_list_entry), GFP_KERNEL);
78 if (!cb_entry)
79 return;
80
81 cb_entry->cb = cb;
82 list_add(&(cb_entry->list), &mem_sampling_record_cb_list);
83 }
84
> 85 void mem_sampling_record_cb_unregister(mem_sampling_record_cb_type cb)
86 {
87 struct mem_sampling_record_cb_list_entry *cb_entry, *tmp;
88
89 list_for_each_entry_safe(cb_entry, tmp, &mem_sampling_record_cb_list, list) {
90 if (cb_entry->cb == cb) {
91 list_del(&cb_entry->list);
92 kfree(cb_entry);
93 return;
94 }
95 }
96 }
97
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-10 2:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 2:18 [openeuler:OLK-6.6 2380/2380] mm/mem_sampling.c:35:18: warning: unused variable 'mem_sampling_min_value' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.