[PATCH 2/4] headers: Add data_race(expr)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 backport/backport-include/linux/compiler.h | 4 ++++
 1 file changed, 4 insertions(+)

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 */
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux