From 7ab9df00f5b9a9a862ffdbf00f4e0812b0a722c1 Mon Sep 17 00:00:00 2001 From: Brian M Date: Thu, 26 Mar 2026 12:22:41 -0700 Subject: [PATCH] scst/include/backport.h: backport WRITE_ONCE for kernels < 3.19 READ_ONCE was already backported; WRITE_ONCE was not, causing a build failure on 3.10. Add the matching definition following the same pattern. --- scst/include/backport.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 69939f41c..d532f5fa8 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -427,7 +427,14 @@ static inline void be32_to_cpu_array(u32 *dst, const __be32 *src, size_t len) * 230fa253df6352af12ad0a16128760b5cb3f92df). */ #define READ_ONCE(x) (*(volatile typeof(x) *)&(x)) +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) && !defined(WRITE_ONCE) +/* + * See also patch "Change ASSIGN_ONCE(val, x) to WRITE_ONCE(x, val)" (commit ID + * 43239cbe79fc369f5d2160bd7f69e28b5c50a58c). + */ +#define WRITE_ONCE(x, val) (*(volatile typeof(x) *)&(x) = (val)) #endif /* */