summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/rcupdate-delete-duplicated-macros.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/rcupdate-delete-duplicated-macros.patch')
-rw-r--r--debian/patches-rt/rcupdate-delete-duplicated-macros.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/debian/patches-rt/rcupdate-delete-duplicated-macros.patch b/debian/patches-rt/rcupdate-delete-duplicated-macros.patch
new file mode 100644
index 000000000..f597ccedf
--- /dev/null
+++ b/debian/patches-rt/rcupdate-delete-duplicated-macros.patch
@@ -0,0 +1,67 @@
+From: Ben Hutchings <benh@debian.org>
+Date: Sun, 24 Sep 2023 20:31:44 +0200
+Subject: rcupdate: Delete duplicated macros
+
+Commit e7d849eab72f mismerged include/linux/rcupdate.h, resulting in
+two macros being defined in both include/linux/rcupdate.h and
+include/linux/rcu_assign_pointer.h. Delete them from rcupdate.h as
+was intended.
+
+---
+--- a/include/linux/rcupdate.h
++++ b/include/linux/rcupdate.h
+@@ -382,54 +382,6 @@ static inline void rcu_preempt_sleep_che
+ })
+
+ /**
+- * RCU_INITIALIZER() - statically initialize an RCU-protected global variable
+- * @v: The value to statically initialize with.
+- */
+-#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
+-
+-/**
+- * rcu_assign_pointer() - assign to RCU-protected pointer
+- * @p: pointer to assign to
+- * @v: value to assign (publish)
+- *
+- * Assigns the specified value to the specified RCU-protected
+- * pointer, ensuring that any concurrent RCU readers will see
+- * any prior initialization.
+- *
+- * Inserts memory barriers on architectures that require them
+- * (which is most of them), and also prevents the compiler from
+- * reordering the code that initializes the structure after the pointer
+- * assignment. More importantly, this call documents which pointers
+- * will be dereferenced by RCU read-side code.
+- *
+- * In some special cases, you may use RCU_INIT_POINTER() instead
+- * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
+- * to the fact that it does not constrain either the CPU or the compiler.
+- * That said, using RCU_INIT_POINTER() when you should have used
+- * rcu_assign_pointer() is a very bad thing that results in
+- * impossible-to-diagnose memory corruption. So please be careful.
+- * See the RCU_INIT_POINTER() comment header for details.
+- *
+- * Note that rcu_assign_pointer() evaluates each of its arguments only
+- * once, appearances notwithstanding. One of the "extra" evaluations
+- * is in typeof() and the other visible only to sparse (__CHECKER__),
+- * neither of which actually execute the argument. As with most cpp
+- * macros, this execute-arguments-only-once property is important, so
+- * please be careful when making changes to rcu_assign_pointer() and the
+- * other macros that it invokes.
+- */
+-#define rcu_assign_pointer(p, v) \
+-({ \
+- uintptr_t _r_a_p__v = (uintptr_t)(v); \
+- \
+- if (__builtin_constant_p(v) && (_r_a_p__v) == (uintptr_t)NULL) \
+- WRITE_ONCE((p), (typeof(p))(_r_a_p__v)); \
+- else \
+- smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
+- _r_a_p__v; \
+-})
+-
+-/**
+ * rcu_replace_pointer() - replace an RCU pointer, returning its old value
+ * @rcu_ptr: RCU pointer, whose old value is returned
+ * @ptr: regular pointer