Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [thomas-weissschuh:b4/auxclock-nanosleep 21/60] kernel/time/hrtimer.c:2092:55: warning: variable 'timer' is uninitialized when used here
@ 2026-07-01 22:19 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-01 22:19 UTC (permalink / raw)
  To: Thomas Weißschuh (Schneider Electric); +Cc: llvm, oe-kbuild-all

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [thomas-weissschuh:b4/auxclock-nanosleep 21/60] kernel/time/hrtimer.c:2092:55: warning: variable 'timer' is uninitialized when used here
@ 2026-07-01 17:51 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-01 17:51 UTC (permalink / raw)
  To: Thomas Weißschuh (Schneider Electric); +Cc: llvm, oe-kbuild-all

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: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260701/202607011937.nn21lRKI-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260701/202607011937.nn21lRKI-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/202607011937.nn21lRKI-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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-01 22:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 22:19 [thomas-weissschuh:b4/auxclock-nanosleep 21/60] kernel/time/hrtimer.c:2092:55: warning: variable 'timer' is uninitialized when used here kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-07-01 17:51 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox