Commit f3964312 authored by Roman Stratiienko's avatar Roman Stratiienko Committed by Jan Kiszka
Browse files

kernel: cobalt: replace ACCESS_ONCE with READ_ONCE

READ_ONCE() introduced from v3.19 commit 230fa253df63
("kernel: Provide READ_ONCE and ASSIGN_ONCE")
and ACCESS_ONCE() removed startibg from v4.15-rc4 commit
b899a850431e ("compiler.h: Remove ACCESS_ONCE()")
Replace ACCESS_ONCE with READ_ONCE and make READ_ONCE wrapper
for case when READ_ONCE is not available (<v3.19)

This will fix build with v4.15
Signed-off-by: default avatarRoman Stratiienko <>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <>
parent 75d5c84b
......@@ -53,11 +53,15 @@ typedef struct {
#define URW_INITIALIZER { 0 }
#define DEFINE_URW(__name) urw_t __name = URW_INITIALIZER
#ifndef READ_ONCE
static inline void __try_read_start(const urw_t *urw, urwstate_t *tmp)
__u32 token;
token = ACCESS_ONCE(urw->sequence);
token = READ_ONCE(urw->sequence);
if (token & 1) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment