summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0005-u64_stats-Introduce-u64_stats_set.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0005-u64_stats-Introduce-u64_stats_set.patch')
-rw-r--r--debian/patches-rt/0005-u64_stats-Introduce-u64_stats_set.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/patches-rt/0005-u64_stats-Introduce-u64_stats_set.patch b/debian/patches-rt/0005-u64_stats-Introduce-u64_stats_set.patch
new file mode 100644
index 000000000..bfee561b6
--- /dev/null
+++ b/debian/patches-rt/0005-u64_stats-Introduce-u64_stats_set.patch
@@ -0,0 +1,45 @@
+From: "Ahmed S. Darwish" <a.darwish@linutronix.de>
+Date: Sat, 16 Oct 2021 10:49:06 +0200
+Subject: [PATCH 5/9] u64_stats: Introduce u64_stats_set()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.15/older/patches-5.15.3-rt21.tar.xz
+
+Allow to directly set a u64_stats_t value which is used to provide an init
+function which sets it directly to zero intead of memset() the value.
+
+Add u64_stats_set() to the u64_stats API.
+
+[bigeasy: commit message. ]
+
+Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ include/linux/u64_stats_sync.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/include/linux/u64_stats_sync.h
++++ b/include/linux/u64_stats_sync.h
+@@ -83,6 +83,11 @@ static inline u64 u64_stats_read(const u
+ return local64_read(&p->v);
+ }
+
++static inline void u64_stats_set(u64_stats_t *p, u64 val)
++{
++ local64_set(&p->v, val);
++}
++
+ static inline void u64_stats_add(u64_stats_t *p, unsigned long val)
+ {
+ local64_add(val, &p->v);
+@@ -104,6 +109,11 @@ static inline u64 u64_stats_read(const u
+ return p->v;
+ }
+
++static inline void u64_stats_set(u64_stats_t *p, u64 val)
++{
++ p->v = val;
++}
++
+ static inline void u64_stats_add(u64_stats_t *p, unsigned long val)
+ {
+ p->v += val;