aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2022-04-03 17:58:16 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-04-10 19:34:26 +0200
commitca0cd5748ee9cec5b0ec059415fa418f2e389d98 (patch)
tree4ff467b08b52c4ea3a6d2e1004f6f84500534688
parent614bdfc343c007c83e787fc461a35602a4b544f5 (diff)
downloadbackports-ca0cd5748ee9cec5b0ec059415fa418f2e389d98.tar.gz
headers: Add data_race(expr)
This define is just a hint for the compiler that it should ignore the data race. It was added to mainline Linux kernel in commit c48981eeb0d5 ("include/linux/compiler.h: Introduce data_race(expr) macro") with kernel 5.8 to provide a hint to the compiler and the reviewer that there is an intentional data race. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/backport/backport-include/linux/compiler.h b/backport/backport-include/linux/compiler.h
index 51a6ec2c..820e6046 100644
--- a/backport/backport-include/linux/compiler.h
+++ b/backport/backport-include/linux/compiler.h
@@ -94,4 +94,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
#define OPTIMIZER_HIDE_VAR(var) barrier()
#endif
+#ifndef data_race
+#define data_race(expr) (expr)
+#endif
+
#endif /* __BACKPORT_LINUX_COMPILER_H */