]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
seqlock: fix raw_read_seqcount_latch()
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 26 May 2016 22:16:06 +0000 (15:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 May 2016 22:35:44 +0000 (15:35 -0700)
lockless_dereference() is supposed to take pointer not integer.

Link: http://lkml.kernel.org/r/20160521201448.GA7429@p183.telecom.by
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/seqlock.h

index e0582106ef4faba81db1ff7912246623c3f7f1c2..7973a821ac58877a56ff5214793786948170ae8e 100644 (file)
@@ -277,7 +277,7 @@ static inline void raw_write_seqcount_barrier(seqcount_t *s)
 
 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_latch(seqcount_t *s)
  *     unsigned seq, idx;
  *
  *     do {
- *             seq = lockless_dereference(latch->seq);
+ *             seq = lockless_dereference(latch)->seq;
  *
  *             idx = seq & 0x01;
  *             entry = data_query(latch->data[idx], ...);