1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
3 Date: Fri, 11 Mar 2022 18:21:04 +0100
4 Subject: [PATCH] headers: fix lockdep_assert_not_held()
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 LOCK_STATE_HELD define was omitted during backport of
10 lockdep_assert_not_held() which leads to build failures of kernels with
13 backports-5.15.8-1/backport-include/linux/lockdep.h:16:47: error: 'LOCK_STATE_HELD' undeclared (first use in this function)
15 Fix it by adding missing LOCK_STATE_HELD define.
17 References: https://github.com/openwrt/openwrt/pull/9373
18 References: https://lore.kernel.org/backports/20220311194800.452-1-ynezz@true.cz/T/#u
19 Fixes: af58b27b1b1a ("headers: Add lockdep_assert_not_held()")
20 Reported-by: Oskari Rauta <oskari.rauta@gmail.com>
21 Signed-off-by: Petr Štetiar <ynezz@true.cz>
23 backport-include/linux/lockdep.h | 3 +++
24 1 file changed, 3 insertions(+)
26 diff --git a/backport-include/linux/lockdep.h b/backport-include/linux/lockdep.h
27 index ed5ea67894e4..842e24b7ff8f 100644
28 --- a/backport-include/linux/lockdep.h
29 +++ b/backport-include/linux/lockdep.h
30 @@ -11,6 +11,9 @@ struct lockdep_map { };
32 #ifndef lockdep_assert_not_held
34 +#ifndef LOCK_STATE_HELD
35 +#define LOCK_STATE_HELD 1
36 +#endif /* LOCK_STATE_HELD */
37 #define lockdep_assert_not_held(l) do { \
38 WARN_ON(debug_locks && \
39 lockdep_is_held(l) == LOCK_STATE_HELD); \