[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202203292115.plWUiMYU-lkp@intel.com>
Date: Tue, 29 Mar 2022 22:02:34 +0800
From: kernel test robot <lkp@...el.com>
To: David Howells <dhowells@...hat.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org, Johannes Weiner <hannes@...xchg.org>,
Ingo Molnar <mingo@...e.hu>, Adrian Bunk <bunk@...sta.de>,
Randy Dunlap <rdunlap@...otime.net>,
Michel Lespinasse <walken@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>
Subject: [hnaz-mm:master 478/481] kernel/synchro-test.c:393:49: warning:
variable 'zeros' set but not used
tree: https://github.com/hnaz/linux-mm master
head: 673977c1d5c4c5bc15abf8f01ebaddc66116a9cd
commit: 52880bd2b8272052d5ccf95f94704a959796c9f6 [478/481] mutex subsystem, synchro-test module
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20220329/202203292115.plWUiMYU-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
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://github.com/hnaz/linux-mm/commit/52880bd2b8272052d5ccf95f94704a959796c9f6
git remote add hnaz-mm https://github.com/hnaz/linux-mm
git fetch --no-tags hnaz-mm master
git checkout 52880bd2b8272052d5ccf95f94704a959796c9f6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
kernel/synchro-test.c:267:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
complete_and_exit(&sp_comp[N], 0);
^
kernel/synchro-test.c:268:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
kernel/synchro-test.c:288:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
complete_and_exit(&mx_comp[N], 0);
^
kernel/synchro-test.c:289:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
kernel/synchro-test.c:309:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
complete_and_exit(&sm_comp[N], 0);
^
kernel/synchro-test.c:310:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
kernel/synchro-test.c:332:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
complete_and_exit(&rd_comp[N], 0);
^
kernel/synchro-test.c:333:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
kernel/synchro-test.c:355:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
complete_and_exit(&wr_comp[N], 0);
^
kernel/synchro-test.c:356:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
kernel/synchro-test.c:383:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
complete_and_exit(&dg_comp[N], 0);
^
kernel/synchro-test.c:384:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
>> kernel/synchro-test.c:393:49: warning: variable 'zeros' set but not used [-Wunused-but-set-variable]
unsigned int tot = 0, max = 0, min = UINT_MAX, zeros = 0, cnt;
^
1 warning and 12 errors generated.
vim +/zeros +393 kernel/synchro-test.c
390
391 static unsigned int total(const char *what, unsigned int counts[], int num)
392 {
> 393 unsigned int tot = 0, max = 0, min = UINT_MAX, zeros = 0, cnt;
394 int loop;
395
396 for (loop = 0; loop < num; loop++) {
397 cnt = counts[loop];
398
399 if (cnt == 0) {
400 zeros++;
401 min = 0;
402 continue;
403 }
404
405 tot += cnt;
406 if (tot > max)
407 max = tot;
408 if (tot < min)
409 min = tot;
410 }
411
412 if (verbose && tot > 0) {
413 printk("%s:", what);
414
415 for (loop = 0; loop < num; loop++) {
416 cnt = counts[loop];
417
418 if (cnt == 0)
419 printk(" zzz");
420 else
421 printk(" %d%%", cnt * 100 / tot);
422 }
423
424 printk("\n");
425 }
426
427 return tot;
428 }
429
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists