summaryrefslogtreecommitdiff
path: root/include/linux/lockdep.h
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2018-01-17 18:14:13 +0300
committerThomas Gleixner <tglx@linutronix.de>2018-01-18 13:56:48 +0300
commit08f36ff642342fb058212099757cb5d40f158c2a (patch)
tree76d1cd26040f49c782799e2d621f80258a33ca2d /include/linux/lockdep.h
parent64f29d1bc9fb8196df3d0f1df694245230e208c0 (diff)
downloadlinux-08f36ff642342fb058212099757cb5d40f158c2a.tar.xz
lockdep: Make lockdep checking constant
There are several places in the kernel which would like to pass a const pointer to lockdep_is_held(). Constify the entire path so nobody has to trick the compiler. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: "David S. Miller" <davem@davemloft.net> Link: https://lkml.kernel.org/r/20180117151414.23686-3-willy@infradead.org
Diffstat (limited to 'include/linux/lockdep.h')
-rw-r--r--include/linux/lockdep.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 3251d9c0d313..864d6fc60fa6 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -337,9 +337,9 @@ extern void lock_release(struct lockdep_map *lock, int nested,
/*
* Same "read" as for lock_acquire(), except -1 means any.
*/
-extern int lock_is_held_type(struct lockdep_map *lock, int read);
+extern int lock_is_held_type(const struct lockdep_map *lock, int read);
-static inline int lock_is_held(struct lockdep_map *lock)
+static inline int lock_is_held(const struct lockdep_map *lock)
{
return lock_is_held_type(lock, -1);
}