public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used
@ 2023-09-11  7:54 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-09-11  7:54 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: oe-kbuild-all, linux-kernel, Thomas Gleixner

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0bb80ecc33a8fb5a682236443c1e740d5c917d1d
commit: 73d20564e0dcae003e0d79977f044d5e57496304 hrtimer: Don't dereference the hrtimer pointer after the callback
date:   3 years, 5 months ago
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20230911/202309111514.seVql7NU-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230911/202309111514.seVql7NU-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/202309111514.seVql7NU-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/time/hrtimer.c:120:35: warning: initialized field overwritten [-Woverride-init]
     120 |         [CLOCK_REALTIME]        = HRTIMER_BASE_REALTIME,
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:120:35: note: (near initialization for 'hrtimer_clock_to_base_table[0]')
   kernel/time/hrtimer.c:121:35: warning: initialized field overwritten [-Woverride-init]
     121 |         [CLOCK_MONOTONIC]       = HRTIMER_BASE_MONOTONIC,
         |                                   ^~~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:121:35: note: (near initialization for 'hrtimer_clock_to_base_table[1]')
   kernel/time/hrtimer.c:122:35: warning: initialized field overwritten [-Woverride-init]
     122 |         [CLOCK_BOOTTIME]        = HRTIMER_BASE_BOOTTIME,
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:122:35: note: (near initialization for 'hrtimer_clock_to_base_table[7]')
   kernel/time/hrtimer.c:123:35: warning: initialized field overwritten [-Woverride-init]
     123 |         [CLOCK_TAI]             = HRTIMER_BASE_TAI,
         |                                   ^~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:123:35: note: (near initialization for 'hrtimer_clock_to_base_table[11]')
   kernel/time/hrtimer.c: In function '__run_hrtimer':
>> kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used [-Wunused-but-set-variable]
    1483 |         bool expires_in_hardirq;
         |              ^~~~~~~~~~~~~~~~~~


vim +/expires_in_hardirq +1483 kernel/time/hrtimer.c

  1458	
  1459	/*
  1460	 * The write_seqcount_barrier()s in __run_hrtimer() split the thing into 3
  1461	 * distinct sections:
  1462	 *
  1463	 *  - queued:	the timer is queued
  1464	 *  - callback:	the timer is being ran
  1465	 *  - post:	the timer is inactive or (re)queued
  1466	 *
  1467	 * On the read side we ensure we observe timer->state and cpu_base->running
  1468	 * from the same section, if anything changed while we looked at it, we retry.
  1469	 * This includes timer->base changing because sequence numbers alone are
  1470	 * insufficient for that.
  1471	 *
  1472	 * The sequence numbers are required because otherwise we could still observe
  1473	 * a false negative if the read side got smeared over multiple consequtive
  1474	 * __run_hrtimer() invocations.
  1475	 */
  1476	
  1477	static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
  1478				  struct hrtimer_clock_base *base,
  1479				  struct hrtimer *timer, ktime_t *now,
  1480				  unsigned long flags) __must_hold(&cpu_base->lock)
  1481	{
  1482		enum hrtimer_restart (*fn)(struct hrtimer *);
> 1483		bool expires_in_hardirq;
  1484		int restart;
  1485	
  1486		lockdep_assert_held(&cpu_base->lock);
  1487	
  1488		debug_deactivate(timer);
  1489		base->running = timer;
  1490	
  1491		/*
  1492		 * Separate the ->running assignment from the ->state assignment.
  1493		 *
  1494		 * As with a regular write barrier, this ensures the read side in
  1495		 * hrtimer_active() cannot observe base->running == NULL &&
  1496		 * timer->state == INACTIVE.
  1497		 */
  1498		raw_write_seqcount_barrier(&base->seq);
  1499	
  1500		__remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0);
  1501		fn = timer->function;
  1502	
  1503		/*
  1504		 * Clear the 'is relative' flag for the TIME_LOW_RES case. If the
  1505		 * timer is restarted with a period then it becomes an absolute
  1506		 * timer. If its not restarted it does not matter.
  1507		 */
  1508		if (IS_ENABLED(CONFIG_TIME_LOW_RES))
  1509			timer->is_rel = false;
  1510	
  1511		/*
  1512		 * The timer is marked as running in the CPU base, so it is
  1513		 * protected against migration to a different CPU even if the lock
  1514		 * is dropped.
  1515		 */
  1516		raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
  1517		trace_hrtimer_expire_entry(timer, now);
  1518		expires_in_hardirq = lockdep_hrtimer_enter(timer);
  1519	
  1520		restart = fn(timer);
  1521	
  1522		lockdep_hrtimer_exit(expires_in_hardirq);
  1523		trace_hrtimer_expire_exit(timer);
  1524		raw_spin_lock_irq(&cpu_base->lock);
  1525	
  1526		/*
  1527		 * Note: We clear the running state after enqueue_hrtimer and
  1528		 * we do not reprogram the event hardware. Happens either in
  1529		 * hrtimer_start_range_ns() or in hrtimer_interrupt()
  1530		 *
  1531		 * Note: Because we dropped the cpu_base->lock above,
  1532		 * hrtimer_start_range_ns() can have popped in and enqueued the timer
  1533		 * for us already.
  1534		 */
  1535		if (restart != HRTIMER_NORESTART &&
  1536		    !(timer->state & HRTIMER_STATE_ENQUEUED))
  1537			enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS);
  1538	
  1539		/*
  1540		 * Separate the ->running assignment from the ->state assignment.
  1541		 *
  1542		 * As with a regular write barrier, this ensures the read side in
  1543		 * hrtimer_active() cannot observe base->running.timer == NULL &&
  1544		 * timer->state == INACTIVE.
  1545		 */
  1546		raw_write_seqcount_barrier(&base->seq);
  1547	
  1548		WARN_ON_ONCE(base->running != timer);
  1549		base->running = NULL;
  1550	}
  1551	

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

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

* kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used
@ 2023-11-12  0:52 kernel test robot
  2023-11-20 15:17 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-11-12  0:52 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: oe-kbuild-all, linux-kernel, Thomas Gleixner

Hi Sebastian,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3ca112b71f35dd5d99fc4571a56b5fc6f0c15814
commit: 73d20564e0dcae003e0d79977f044d5e57496304 hrtimer: Don't dereference the hrtimer pointer after the callback
date:   3 years, 7 months ago
config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20231112/202311120815.33YfGjzD-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231112/202311120815.33YfGjzD-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/202311120815.33YfGjzD-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/time/hrtimer.c:120:35: warning: initialized field overwritten [-Woverride-init]
     120 |         [CLOCK_REALTIME]        = HRTIMER_BASE_REALTIME,
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:120:35: note: (near initialization for 'hrtimer_clock_to_base_table[0]')
   kernel/time/hrtimer.c:121:35: warning: initialized field overwritten [-Woverride-init]
     121 |         [CLOCK_MONOTONIC]       = HRTIMER_BASE_MONOTONIC,
         |                                   ^~~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:121:35: note: (near initialization for 'hrtimer_clock_to_base_table[1]')
   kernel/time/hrtimer.c:122:35: warning: initialized field overwritten [-Woverride-init]
     122 |         [CLOCK_BOOTTIME]        = HRTIMER_BASE_BOOTTIME,
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:122:35: note: (near initialization for 'hrtimer_clock_to_base_table[7]')
   kernel/time/hrtimer.c:123:35: warning: initialized field overwritten [-Woverride-init]
     123 |         [CLOCK_TAI]             = HRTIMER_BASE_TAI,
         |                                   ^~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:123:35: note: (near initialization for 'hrtimer_clock_to_base_table[11]')
   kernel/time/hrtimer.c: In function '__run_hrtimer':
>> kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used [-Wunused-but-set-variable]
    1483 |         bool expires_in_hardirq;
         |              ^~~~~~~~~~~~~~~~~~


vim +/expires_in_hardirq +1483 kernel/time/hrtimer.c

  1458	
  1459	/*
  1460	 * The write_seqcount_barrier()s in __run_hrtimer() split the thing into 3
  1461	 * distinct sections:
  1462	 *
  1463	 *  - queued:	the timer is queued
  1464	 *  - callback:	the timer is being ran
  1465	 *  - post:	the timer is inactive or (re)queued
  1466	 *
  1467	 * On the read side we ensure we observe timer->state and cpu_base->running
  1468	 * from the same section, if anything changed while we looked at it, we retry.
  1469	 * This includes timer->base changing because sequence numbers alone are
  1470	 * insufficient for that.
  1471	 *
  1472	 * The sequence numbers are required because otherwise we could still observe
  1473	 * a false negative if the read side got smeared over multiple consequtive
  1474	 * __run_hrtimer() invocations.
  1475	 */
  1476	
  1477	static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
  1478				  struct hrtimer_clock_base *base,
  1479				  struct hrtimer *timer, ktime_t *now,
  1480				  unsigned long flags) __must_hold(&cpu_base->lock)
  1481	{
  1482		enum hrtimer_restart (*fn)(struct hrtimer *);
> 1483		bool expires_in_hardirq;
  1484		int restart;
  1485	
  1486		lockdep_assert_held(&cpu_base->lock);
  1487	
  1488		debug_deactivate(timer);
  1489		base->running = timer;
  1490	
  1491		/*
  1492		 * Separate the ->running assignment from the ->state assignment.
  1493		 *
  1494		 * As with a regular write barrier, this ensures the read side in
  1495		 * hrtimer_active() cannot observe base->running == NULL &&
  1496		 * timer->state == INACTIVE.
  1497		 */
  1498		raw_write_seqcount_barrier(&base->seq);
  1499	
  1500		__remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0);
  1501		fn = timer->function;
  1502	
  1503		/*
  1504		 * Clear the 'is relative' flag for the TIME_LOW_RES case. If the
  1505		 * timer is restarted with a period then it becomes an absolute
  1506		 * timer. If its not restarted it does not matter.
  1507		 */
  1508		if (IS_ENABLED(CONFIG_TIME_LOW_RES))
  1509			timer->is_rel = false;
  1510	
  1511		/*
  1512		 * The timer is marked as running in the CPU base, so it is
  1513		 * protected against migration to a different CPU even if the lock
  1514		 * is dropped.
  1515		 */
  1516		raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
  1517		trace_hrtimer_expire_entry(timer, now);
  1518		expires_in_hardirq = lockdep_hrtimer_enter(timer);
  1519	
  1520		restart = fn(timer);
  1521	
  1522		lockdep_hrtimer_exit(expires_in_hardirq);
  1523		trace_hrtimer_expire_exit(timer);
  1524		raw_spin_lock_irq(&cpu_base->lock);
  1525	
  1526		/*
  1527		 * Note: We clear the running state after enqueue_hrtimer and
  1528		 * we do not reprogram the event hardware. Happens either in
  1529		 * hrtimer_start_range_ns() or in hrtimer_interrupt()
  1530		 *
  1531		 * Note: Because we dropped the cpu_base->lock above,
  1532		 * hrtimer_start_range_ns() can have popped in and enqueued the timer
  1533		 * for us already.
  1534		 */
  1535		if (restart != HRTIMER_NORESTART &&
  1536		    !(timer->state & HRTIMER_STATE_ENQUEUED))
  1537			enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS);
  1538	
  1539		/*
  1540		 * Separate the ->running assignment from the ->state assignment.
  1541		 *
  1542		 * As with a regular write barrier, this ensures the read side in
  1543		 * hrtimer_active() cannot observe base->running.timer == NULL &&
  1544		 * timer->state == INACTIVE.
  1545		 */
  1546		raw_write_seqcount_barrier(&base->seq);
  1547	
  1548		WARN_ON_ONCE(base->running != timer);
  1549		base->running = NULL;
  1550	}
  1551	

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

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

* kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used
@ 2023-11-19  4:35 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-11-19  4:35 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: oe-kbuild-all, linux-kernel, Thomas Gleixner

Hi Sebastian,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b8f1fa2419c19c81bc386a6b350879ba54a573e1
commit: 73d20564e0dcae003e0d79977f044d5e57496304 hrtimer: Don't dereference the hrtimer pointer after the callback
date:   3 years, 8 months ago
config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20231119/202311191229.55QXHVc6-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231119/202311191229.55QXHVc6-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/202311191229.55QXHVc6-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/time/hrtimer.c:120:35: warning: initialized field overwritten [-Woverride-init]
     120 |         [CLOCK_REALTIME]        = HRTIMER_BASE_REALTIME,
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:120:35: note: (near initialization for 'hrtimer_clock_to_base_table[0]')
   kernel/time/hrtimer.c:121:35: warning: initialized field overwritten [-Woverride-init]
     121 |         [CLOCK_MONOTONIC]       = HRTIMER_BASE_MONOTONIC,
         |                                   ^~~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:121:35: note: (near initialization for 'hrtimer_clock_to_base_table[1]')
   kernel/time/hrtimer.c:122:35: warning: initialized field overwritten [-Woverride-init]
     122 |         [CLOCK_BOOTTIME]        = HRTIMER_BASE_BOOTTIME,
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:122:35: note: (near initialization for 'hrtimer_clock_to_base_table[7]')
   kernel/time/hrtimer.c:123:35: warning: initialized field overwritten [-Woverride-init]
     123 |         [CLOCK_TAI]             = HRTIMER_BASE_TAI,
         |                                   ^~~~~~~~~~~~~~~~
   kernel/time/hrtimer.c:123:35: note: (near initialization for 'hrtimer_clock_to_base_table[11]')
   kernel/time/hrtimer.c: In function '__run_hrtimer':
>> kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used [-Wunused-but-set-variable]
    1483 |         bool expires_in_hardirq;
         |              ^~~~~~~~~~~~~~~~~~


vim +/expires_in_hardirq +1483 kernel/time/hrtimer.c

  1458	
  1459	/*
  1460	 * The write_seqcount_barrier()s in __run_hrtimer() split the thing into 3
  1461	 * distinct sections:
  1462	 *
  1463	 *  - queued:	the timer is queued
  1464	 *  - callback:	the timer is being ran
  1465	 *  - post:	the timer is inactive or (re)queued
  1466	 *
  1467	 * On the read side we ensure we observe timer->state and cpu_base->running
  1468	 * from the same section, if anything changed while we looked at it, we retry.
  1469	 * This includes timer->base changing because sequence numbers alone are
  1470	 * insufficient for that.
  1471	 *
  1472	 * The sequence numbers are required because otherwise we could still observe
  1473	 * a false negative if the read side got smeared over multiple consequtive
  1474	 * __run_hrtimer() invocations.
  1475	 */
  1476	
  1477	static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
  1478				  struct hrtimer_clock_base *base,
  1479				  struct hrtimer *timer, ktime_t *now,
  1480				  unsigned long flags) __must_hold(&cpu_base->lock)
  1481	{
  1482		enum hrtimer_restart (*fn)(struct hrtimer *);
> 1483		bool expires_in_hardirq;
  1484		int restart;
  1485	
  1486		lockdep_assert_held(&cpu_base->lock);
  1487	
  1488		debug_deactivate(timer);
  1489		base->running = timer;
  1490	
  1491		/*
  1492		 * Separate the ->running assignment from the ->state assignment.
  1493		 *
  1494		 * As with a regular write barrier, this ensures the read side in
  1495		 * hrtimer_active() cannot observe base->running == NULL &&
  1496		 * timer->state == INACTIVE.
  1497		 */
  1498		raw_write_seqcount_barrier(&base->seq);
  1499	
  1500		__remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0);
  1501		fn = timer->function;
  1502	
  1503		/*
  1504		 * Clear the 'is relative' flag for the TIME_LOW_RES case. If the
  1505		 * timer is restarted with a period then it becomes an absolute
  1506		 * timer. If its not restarted it does not matter.
  1507		 */
  1508		if (IS_ENABLED(CONFIG_TIME_LOW_RES))
  1509			timer->is_rel = false;
  1510	
  1511		/*
  1512		 * The timer is marked as running in the CPU base, so it is
  1513		 * protected against migration to a different CPU even if the lock
  1514		 * is dropped.
  1515		 */
  1516		raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
  1517		trace_hrtimer_expire_entry(timer, now);
  1518		expires_in_hardirq = lockdep_hrtimer_enter(timer);
  1519	
  1520		restart = fn(timer);
  1521	
  1522		lockdep_hrtimer_exit(expires_in_hardirq);
  1523		trace_hrtimer_expire_exit(timer);
  1524		raw_spin_lock_irq(&cpu_base->lock);
  1525	
  1526		/*
  1527		 * Note: We clear the running state after enqueue_hrtimer and
  1528		 * we do not reprogram the event hardware. Happens either in
  1529		 * hrtimer_start_range_ns() or in hrtimer_interrupt()
  1530		 *
  1531		 * Note: Because we dropped the cpu_base->lock above,
  1532		 * hrtimer_start_range_ns() can have popped in and enqueued the timer
  1533		 * for us already.
  1534		 */
  1535		if (restart != HRTIMER_NORESTART &&
  1536		    !(timer->state & HRTIMER_STATE_ENQUEUED))
  1537			enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS);
  1538	
  1539		/*
  1540		 * Separate the ->running assignment from the ->state assignment.
  1541		 *
  1542		 * As with a regular write barrier, this ensures the read side in
  1543		 * hrtimer_active() cannot observe base->running.timer == NULL &&
  1544		 * timer->state == INACTIVE.
  1545		 */
  1546		raw_write_seqcount_barrier(&base->seq);
  1547	
  1548		WARN_ON_ONCE(base->running != timer);
  1549		base->running = NULL;
  1550	}
  1551	

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

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

* Re: kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used
  2023-11-12  0:52 kernel test robot
@ 2023-11-20 15:17 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2023-11-20 15:17 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel, Thomas Gleixner

On 2023-11-12 08:52:44 [+0800], kernel test robot wrote:
> Hi Sebastian,
Hi,

> FYI, the error/warning still remains.
> 
>    kernel/time/hrtimer.c:120:35: warning: initialized field overwritten [-Woverride-init]
>      120 |         [CLOCK_REALTIME]        = HRTIMER_BASE_REALTIME,
>          |                                   ^~~~~~~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:120:35: note: (near initialization for 'hrtimer_clock_to_base_table[0]')
>    kernel/time/hrtimer.c:121:35: warning: initialized field overwritten [-Woverride-init]
>      121 |         [CLOCK_MONOTONIC]       = HRTIMER_BASE_MONOTONIC,
>          |                                   ^~~~~~~~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:121:35: note: (near initialization for 'hrtimer_clock_to_base_table[1]')
>    kernel/time/hrtimer.c:122:35: warning: initialized field overwritten [-Woverride-init]
>      122 |         [CLOCK_BOOTTIME]        = HRTIMER_BASE_BOOTTIME,
>          |                                   ^~~~~~~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:122:35: note: (near initialization for 'hrtimer_clock_to_base_table[7]')
>    kernel/time/hrtimer.c:123:35: warning: initialized field overwritten [-Woverride-init]
>      123 |         [CLOCK_TAI]             = HRTIMER_BASE_TAI,
>          |                                   ^~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:123:35: note: (near initialization for 'hrtimer_clock_to_base_table[11]')

This is "okay". The array is first initialized completely to a safe
value and then a few of the individual values are overwritten.
So this "initialized field overwritten", that the compiler complains
about, is intended here. 

>    kernel/time/hrtimer.c: In function '__run_hrtimer':
> >> kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used [-Wunused-but-set-variable]
>     1483 |         bool expires_in_hardirq;
>          |              ^~~~~~~~~~~~~~~~~~

This is because the code using it is disabled at build time. I could
tweak the code to make look it used in the off case so the warning goes
away.

Sebastian

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

end of thread, other threads:[~2023-11-20 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11  7:54 kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-11-12  0:52 kernel test robot
2023-11-20 15:17 ` Sebastian Andrzej Siewior
2023-11-19  4:35 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