Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
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 21/60] kernel/time/hrtimer.c:2092:55: warning: variable 'timer' is uninitialized when used here
Date: Thu, 02 Jul 2026 06:19:33 +0800	[thread overview]
Message-ID: <202607020630.c13YhNOy-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git b4/auxclock-nanosleep
head:   80d7be4639ebb1f847fd06f3b8ad6b60389a6399
commit: ab89377d780b43204be2991594e25d64d4de0c88 [21/60] validation
config: hexagon-allnoconfig (https://download.01.org/0day-ci/archive/20260702/202607020630.c13YhNOy-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 6cc609bb250b21b47fc7d394b4019101e9983597)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260702/202607020630.c13YhNOy-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/202607020630.c13YhNOy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/time/hrtimer.c:2092:55: warning: variable 'timer' is uninitialized when used here [-Wuninitialized]
    2092 |                 if (trace_hrtimer_run_queues_deviation_enabled() && timer) {
         |                                                                     ^~~~~
   kernel/time/hrtimer.c:2090:24: note: initialize the variable 'timer' to silence this warning
    2090 |                 struct hrtimer *timer;
         |                                      ^
         |                                       = NULL
   1 warning generated.


vim +/timer +2092 kernel/time/hrtimer.c

  2081	
  2082	static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now,
  2083					 unsigned long flags, unsigned int active_mask)
  2084	{
  2085		unsigned int active = cpu_base->active_bases & active_mask;
  2086		struct hrtimer_clock_base *base;
  2087	
  2088		for_each_active_base(base, cpu_base, active) {
  2089			ktime_t basenow = ktime_add(now, base->offset);
  2090			struct hrtimer *timer;
  2091	
> 2092			if (trace_hrtimer_run_queues_deviation_enabled() && timer) {
  2093				timer = clock_base_next_timer(base);
  2094	
  2095				if (timer) {
  2096					ktime_t real_basenow = hrtimer_cb_get_time(timer);
  2097	
  2098					/* Should never be negative */
  2099					trace_hrtimer_run_queues_deviation(cpu_base, base->clockid,
  2100									   ktime_sub(real_basenow, basenow));
  2101				}
  2102			}
  2103	
  2104			while ((timer = clock_base_next_timer(base))) {
  2105				/*
  2106				 * The immediate goal for using the softexpires is
  2107				 * minimizing wakeups, not running timers at the
  2108				 * earliest interrupt after their soft expiration.
  2109				 * This allows us to avoid using a Priority Search
  2110				 * Tree, which can answer a stabbing query for
  2111				 * overlapping intervals and instead use the simple
  2112				 * BST we already have.
  2113				 * We don't add extra wakeups by delaying timers that
  2114				 * are right-of a not yet expired timer, because that
  2115				 * timer will have to trigger a wakeup anyway.
  2116				 */
  2117				if (basenow < hrtimer_get_softexpires(timer))
  2118					break;
  2119	
  2120				__run_hrtimer(cpu_base, base, timer, basenow, flags);
  2121				if (active_mask == HRTIMER_ACTIVE_SOFT)
  2122					hrtimer_sync_wait_running(cpu_base, flags);
  2123			}
  2124		}
  2125	}
  2126	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2026-07-01 22:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 22:19 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-01 17:51 [thomas-weissschuh:b4/auxclock-nanosleep 21/60] kernel/time/hrtimer.c:2092:55: warning: variable 'timer' is uninitialized when used here 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=202607020630.c13YhNOy-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