aboutsummaryrefslogtreecommitdiff
path: root/pkgs/patches-linux-5.15/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch
blob: 22f52c1d46258ca4afa791f8cdedcdaf05db5cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 22 Oct 2020 22:00:03 +0200
Subject: [PATCH] compiler.h: only include asm/rwonce.h for kernel code

This header file is not in uapi, which makes any user space code that includes
linux/compiler.h to fail with the error 'asm/rwonce.h: No such file or directory'

Fixes: e506ea451254 ("compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---

--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -220,6 +220,8 @@ void ftrace_likely_update(struct ftrace_
 #define function_nocfi(x) (x)
 #endif
 
+#include <asm/rwonce.h>
+
 #endif /* __KERNEL__ */
 
 /*
@@ -252,6 +254,4 @@ static inline void *offset_to_ptr(const
  */
 #define prevent_tail_call_optimization()	mb()
 
-#include <asm/rwonce.h>
-
 #endif /* __LINUX_COMPILER_H */