[peterz-queue:sched/core 13/19] kernel/sched/core.c:10238:42: warning: variable 'stats' set but not used

From: kernel test robot
Date: Fri Sep 10 2021 - 14:29:57 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core
head: 2dfdb3d20ad50e2ae2cb84cbceb0f0fc75e79e5d
commit: 445d9e8ba05d5e9e4b26956b7fe529223e29d8d1 [13/19] sched: make struct sched_statistics independent of fair sched class
config: nds32-buildonly-randconfig-r001-20210910 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=445d9e8ba05d5e9e4b26956b7fe529223e29d8d1
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/core
git checkout 445d9e8ba05d5e9e4b26956b7fe529223e29d8d1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nds32

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/sched/core.c: In function 'ttwu_stat':
kernel/sched/core.c:3465:20: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
3465 | struct rq *rq;
| ^~
kernel/sched/core.c: In function 'cpu_cfs_stat_show':
>> kernel/sched/core.c:10238:42: warning: variable 'stats' set but not used [-Wunused-but-set-variable]
10238 | struct sched_statistics *stats;
| ^~~~~


vim +/stats +10238 kernel/sched/core.c

10227
10228 static int cpu_cfs_stat_show(struct seq_file *sf, void *v)
10229 {
10230 struct task_group *tg = css_tg(seq_css(sf));
10231 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
10232
10233 seq_printf(sf, "nr_periods %d\n", cfs_b->nr_periods);
10234 seq_printf(sf, "nr_throttled %d\n", cfs_b->nr_throttled);
10235 seq_printf(sf, "throttled_time %llu\n", cfs_b->throttled_time);
10236
10237 if (schedstat_enabled() && tg != &root_task_group) {
10238 struct sched_statistics *stats;
10239 u64 ws = 0;
10240 int i;
10241
10242 for_each_possible_cpu(i) {
10243 stats = __schedstats_from_se(tg->se[i]);
10244 ws += schedstat_val(stats->wait_sum);
10245 }
10246
10247 seq_printf(sf, "wait_sum %llu\n", ws);
10248 }
10249
10250 seq_printf(sf, "nr_bursts %d\n", cfs_b->nr_burst);
10251 seq_printf(sf, "burst_time %llu\n", cfs_b->burst_time);
10252
10253 return 0;
10254 }
10255 #endif /* CONFIG_CFS_BANDWIDTH */
10256 #endif /* CONFIG_FAIR_GROUP_SCHED */
10257

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip