hrtimer: Make the argument passed to lockdep_hrtimer_exit() look used.

Message ID 20231120153953.kGBSHe5j@linutronix.de
State New
Headers
Series hrtimer: Make the argument passed to lockdep_hrtimer_exit() look used. |

Commit Message

Sebastian Andrzej Siewior Nov. 20, 2023, 3:39 p.m. UTC
  The lockdep_hrtimer_enter() macro returns a value which is then saved in
a local variable. The value is then fed to lockdep_hrtimer_exit(). In
case lockdep is disabled then the value remains unused leading to a "set
but not used" warning by the compiler.

Make the content passed to lockdep_hrtimer_exit() look used so the
compiler does not complain about it.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311191229.55QXHVc6-lkp@intel.com/
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/irqflags.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index 2b665c32f5fe6..2e09c269bf9d8 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -126,7 +126,7 @@  do {						\
 # define lockdep_softirq_enter()		do { } while (0)
 # define lockdep_softirq_exit()			do { } while (0)
 # define lockdep_hrtimer_enter(__hrtimer)	false
-# define lockdep_hrtimer_exit(__context)	do { } while (0)
+# define lockdep_hrtimer_exit(__context)	do { (void)(__context); } while (0)
 # define lockdep_posixtimer_enter()		do { } while (0)
 # define lockdep_posixtimer_exit()		do { } while (0)
 # define lockdep_irq_work_enter(__work)		do { } while (0)