lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20221114005346.1728227-1-zhuyifei@google.com>
Date:   Mon, 14 Nov 2022 00:53:45 +0000
From:   YiFei Zhu <zhuyifei@...gle.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Thelford Williams <tdwilliamsiv@...il.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        linux-kernel@...r.kernel.org, YiFei Zhu <zhuyifei@...gle.com>
Subject: [PATCH] hrtimer: Fix 'set but not used' warning with lockdep_hrtimer_exit

In a defconfig build with 'unused-but-set-variable' enabled, we get:

  kernel/time/hrtimer.c: In function ‘__run_hrtimer’:
  kernel/time/hrtimer.c:1648:14: error: variable ‘expires_in_hardirq’
set but not used [-Werror=unused-but-set-variable]
   1648 |         bool expires_in_hardirq;
        |              ^~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Resolve this by evaluating expires_in_hardirq and casting it to void.

Reported-by: Thelford Williams <tdwilliamsiv@...il.com>
Fixes: 40db173965c0 ("lockdep: Add hrtimer context tracing bits")
Signed-off-by: YiFei Zhu <zhuyifei@...gle.com>
---
 include/linux/irqflags.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index 5ec0fa71399e..df74d0df8e1f 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -125,7 +125,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)	((void)(__context))
 # define lockdep_posixtimer_enter()		do { } while (0)
 # define lockdep_posixtimer_exit()		do { } while (0)
 # define lockdep_irq_work_enter(__work)		do { } while (0)
-- 
2.38.1.493.g58b659f92b-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ