From: kernel test robot <lkp@intel.com>
To: "Thomas Weißschuh (Schneider Electric)"
<thomas.weissschuh@linutronix.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [thomas-weissschuh:b4/auxclock-nanosleep 17/44] kernel/time/benchmarks.c:65:8: warning: variable 'b' is used uninitialized whenever 'if' condition is true
Date: Thu, 30 Apr 2026 03:19:44 +0200 [thread overview]
Message-ID: <202604300314.gaiQVLYr-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git b4/auxclock-nanosleep
head: 3e5442acb7e21f08c3eff2ecdace624b6647d5b1
commit: 2d4cde60596e5113f58afbb253423ffcabc891ac [17/44] benchmarks
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260430/202604300314.gaiQVLYr-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300314.gaiQVLYr-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/202604300314.gaiQVLYr-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/time/benchmarks.c:65:8: warning: variable 'b' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
65 | if (!ktime_get_aux(CLOCK_AUX, &a)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/time/benchmarks.c:76:13: note: uninitialized use occurs here
76 | *sample = b - a;
| ^
kernel/time/benchmarks.c:65:4: note: remove the 'if' if its condition is always false
65 | if (!ktime_get_aux(CLOCK_AUX, &a)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66 | *sample = KTIME_MAX;
| ~~~~~~~~~~~~~~~~~~~~
67 | continue;
| ~~~~~~~~~
68 | }
| ~
kernel/time/benchmarks.c:62:15: note: initialize the variable 'b' to silence this warning
62 | ktime_t a, b;
| ^
| = 0
1 warning generated.
vim +65 kernel/time/benchmarks.c
57
58 static void benchmark_ktime_get_aux(struct benchmark_samples *samples)
59 {
60 for (size_t l = 0; l < ARRAY_SIZE(samples->d); l++) {
61 ktime_t *sample = &samples->d[l];
62 ktime_t a, b;
63
64 scoped_guard(preempt) {
> 65 if (!ktime_get_aux(CLOCK_AUX, &a)) {
66 *sample = KTIME_MAX;
67 continue;
68 }
69
70 if (!ktime_get_aux(CLOCK_AUX, &b)) {
71 *sample = KTIME_MAX;
72 continue;
73 }
74 }
75
76 *sample = b - a;
77 }
78 }
79
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-04-30 1:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 1:19 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-29 21:23 [thomas-weissschuh:b4/auxclock-nanosleep 17/44] kernel/time/benchmarks.c:65:8: warning: variable 'b' is used uninitialized whenever 'if' condition is true kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202604300314.gaiQVLYr-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox