[openeuler:OLK-6.6 2519/2519] kernel/cgroup/ifs.c:400:6: warning: variable 'start' set but not used

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 0a2a4d6188250982405816f6ee5b085bfb522721 commit: bc298fe613e2a09d9b804de1212c31fb0d375a47 [2519/2519] interference: Add distribution histogram support config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20250716/202507162216.3Q6gsro5-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/20250716/202507162216.3Q6gsro5-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/202507162216.3Q6gsro5-lkp@intel.com/ All warnings (new ones prefixed by >>):
kernel/cgroup/ifs.c:400:6: warning: variable 'start' set but not used [-Wunused-but-set-variable] 400 | u64 start; | ^ 1 warning generated.
vim +/start +400 kernel/cgroup/ifs.c 393 394 static int print_hist_count(struct cgroup_ifs *ifs, struct seq_file *seq) 395 { 396 struct cgroup_ifs_hist *h; 397 struct ifs_tdesc *desc; 398 bool is_print_title; 399 const char *name;
400 u64 start; 401 int count; 402 int i, j; 403 int cpu; 404 405 h = kzalloc(sizeof(struct cgroup_ifs_hist), GFP_KERNEL); 406 if (!h) 407 return -ENOMEM; 408 409 for_each_possible_cpu(cpu) { 410 struct cgroup_ifs_cpu *ifsc = per_cpu_ptr(ifs->pcpu, cpu); 411 412 for (i = 0; i < NR_IFS_TYPES; i++) { 413 if (!should_print(i)) 414 continue; 415 for (j = 0; j < CGROUP_IFS_HIST_SLOTS; j++) 416 h->counts[i][j] += ifsc->hist.counts[i][j]; 417 } 418 } 419 420 for (i = 0; i < NR_IFS_TYPES; i++) { 421 name = ifs_type_name(i); 422 is_print_title = false; 423 start = 1ULL << 63; 424 425 if (!should_print(i)) 426 continue; 427 428 if (i == IFS_SPINLOCK || i == IFS_MUTEX) 429 desc = &ifs_tdesc[IFS_TIMER_TSC]; 430 else 431 desc = &ifs_tdesc[IFS_TIMER_CLK]; 432 433 count = 0; 434 for (j = 0; j < CGROUP_IFS_HIST_SLOTS; j++) { 435 if (j < desc->tdesc_num) { 436 count += h->counts[i][j]; 437 continue; 438 } else if (j == desc->tdesc_num) { 439 count += h->counts[i][j]; 440 } else { 441 count = h->counts[i][j]; 442 } 443 444 if (count) { 445 if (unlikely(!is_print_title)) { 446 is_print_title = true; 447 seq_printf(seq, "%s distribution\n", name); 448 } 449 seq_printf(seq, "%-24s: %d\n", 450 desc->tdesc_str[j], count); 451 } 452 start /= 2; 453 } 454 455 if (is_print_title) 456 seq_puts(seq, "\n"); 457 } 458 459 kfree(h); 460 return 0; 461 } 462
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot