Skip to contentSkip to conversation

seqlock: fix raw_read_seqcount_latch()

PATCH New [email protected] 1 participant 1 message May 26, 2016 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 seqlock: fix raw_read_seqcount_latch()

From: Alexey Dobriyan <[email protected]>
Subject: seqlock: fix raw_read_seqcount_latch()

lockless_dereference() is supposed to take pointer not integer.

---

 include/linux/seqlock.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/seqlock.h renamed from include/linux/seqlock.h~seqlock-fix-raw_read_seqcount_latch +2 -2
diff -puN include/linux/seqlock.h~seqlock-fix-raw_read_seqcount_latch include/linux/seqlock.h
@@ -277,7 +277,7 @@ static inline void raw_write_seqcount_ba
 
 static inline int raw_read_seqcount_latch(seqcount_t *s)
 {
-	return lockless_dereference(s->sequence);
+	return lockless_dereference(s)->sequence;
 }
 
 /**
@@ -331,7 +331,7 @@ static inline int raw_read_seqcount_latc
  *	unsigned seq, idx;
  *
  *	do {
- *		seq = lockless_dereference(latch->seq);
+ *		seq = lockless_dereference(latch)->seq;
  *
  *		idx = seq & 0x01;
  *		entry = data_query(latch->data[idx], ...);

_