tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 1910604f7315d411c0c10359055daddee968441f commit: d91c6db8ca896824da23aab69dde9ce289222299 [2153/13948] cpuinspect: add CPU-inspect infrastructure config: loongarch-randconfig-r133-20240913 (https://download.01.org/0day-ci/archive/20240914/202409141939.mPFkQsG4-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.1.0 reproduce: (https://download.01.org/0day-ci/archive/20240914/202409141939.mPFkQsG4-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/202409141939.mPFkQsG4-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/cpuinspect/sysfs.c:92:9: sparse: sparse: symbol 'patrol_complete_show' was not declared. Should it be static? drivers/cpuinspect/sysfs.c:98:9: sparse: sparse: symbol 'cpu_utility_show' was not declared. Should it be static? drivers/cpuinspect/sysfs.c:104:9: sparse: sparse: symbol 'cpu_utility_store' was not declared. Should it be static? drivers/cpuinspect/sysfs.c:117:9: sparse: sparse: symbol 'patrol_times_show' was not declared. Should it be static? drivers/cpuinspect/sysfs.c:123:9: sparse: sparse: symbol 'patrol_times_store' was not declared. Should it be static? drivers/cpuinspect/sysfs.c:139:9: sparse: sparse: symbol 'start_patrol_store' was not declared. Should it be static?
--
drivers/cpuinspect/inspector.c:34:22: sparse: sparse: symbol 'prev_cpu_inspector' was not declared. Should it be static?
drivers/cpuinspect/inspector.c: note: in included file (through include/linux/rculist.h, include/linux/pid.h, include/linux/sched.h, ...): include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
vim +/patrol_complete_show +92 drivers/cpuinspect/sysfs.c
91
92 ssize_t patrol_complete_show(struct device *dev, struct device_attribute *attr,
93 char *buf) 94 { 95 return sprintf(buf, "%d\n", !ci_core.inspect_on); 96 } 97
98 ssize_t cpu_utility_show(struct device *dev, struct device_attribute *attr,
99 char *buf) 100 { 101 return sprintf(buf, "%u\n", ci_core.cpu_utility); 102 } 103
104 ssize_t cpu_utility_store(struct device *dev, struct device_attribute *attr,
105 const char *buf, size_t size) 106 { 107 unsigned int cpu_util; 108 109 if (kstrtouint(buf, 10, &cpu_util) || cpu_util < 1 || cpu_util > 100) 110 return -EINVAL; 111 112 ci_core.cpu_utility = cpu_util; 113 114 return size; 115 } 116
117 ssize_t patrol_times_show(struct device *dev, struct device_attribute *attr,
118 char *buf) 119 { 120 return sprintf(buf, "%lu\n", ci_core.inspect_times); 121 } 122
123 ssize_t patrol_times_store(struct device *dev, struct device_attribute *attr,
124 const char *buf, size_t size) 125 { 126 /* 127 * It is not allowed to modify patrol times during the CPU 128 * inspection operation. 129 */ 130 if (ci_core.inspect_on) 131 return -EBUSY; 132 133 if (kstrtoul(buf, 10, &ci_core.inspect_times)) 134 return -EINVAL; 135 136 return size; 137 } 138
139 ssize_t start_patrol_store(struct device *dev, struct device_attribute *attr,
140 const char *buf, size_t size) 141 { 142 bool start_patrol = false; 143 144 if (strtobool(buf, &start_patrol) < 0) 145 return -EINVAL; 146 147 if (!mutex_trylock(&cpuinspect_lock)) 148 return -EBUSY; 149 150 /* 151 * It is not allowed to start the inspection again during the 152 * inspection process. 153 */ 154 if (start_patrol && (int) start_patrol == ci_core.inspect_on) { 155 mutex_unlock(&cpuinspect_lock); 156 return -EBUSY; 157 } 158 159 if (start_patrol == 0) 160 stop_inspect_threads(); 161 else if (curr_cpu_inspector) 162 start_inspect_threads(); 163 164 mutex_unlock(&cpuinspect_lock); 165 return size; 166 } 167