aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/spinlock_api_up.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2022-08-25 18:08:56 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-09-15 16:14:02 +0200
commit2747b93ebbede2af2d7bb088b9ddae3193ceede8 (patch)
treeb713e2ab0a3450f74c76a752dac2c973b670ab3e /include/linux/spinlock_api_up.h
parentlocking: Add __lockfunc to slow path functions (diff)
downloadwireguard-linux-2747b93ebbede2af2d7bb088b9ddae3193ceede8.tar.xz
wireguard-linux-2747b93ebbede2af2d7bb088b9ddae3193ceede8.zip
locking: Detect includes rwlock.h outside of spinlock.h
From: Michael S. Tsirkin <mst@redhat.com> The check for __LINUX_SPINLOCK_H within rwlock.h (and other files) detects the direct include of the header file if it is at the very beginning of the include section. If it is listed later then chances are high that spinlock.h was already included (including rwlock.h) and the additional listing of rwlock.h will not cause any failure. On PREEMPT_RT this additional rwlock.h will lead to compile failures since it uses a different rwlock implementation. Add __LINUX_INSIDE_SPINLOCK_H to spinlock.h and check for this instead of __LINUX_SPINLOCK_H to detect wrong includes. This will help detect direct includes of rwlock.h with without PREEMPT_RT enabled. [ bigeasy: add remaining __LINUX_SPINLOCK_H user and rewrite commit description. ] Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/YweemHxJx7O8rjBx@linutronix.de
Diffstat (limited to 'include/linux/spinlock_api_up.h')
-rw-r--r--include/linux/spinlock_api_up.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h
index b8ba00ccccde..819aeba1c87e 100644
--- a/include/linux/spinlock_api_up.h
+++ b/include/linux/spinlock_api_up.h
@@ -1,7 +1,7 @@
#ifndef __LINUX_SPINLOCK_API_UP_H
#define __LINUX_SPINLOCK_API_UP_H
-#ifndef __LINUX_SPINLOCK_H
+#ifndef __LINUX_INSIDE_SPINLOCK_H
# error "please don't include this file directly"
#endif