Commit 74df55cf12da35361087869e3e4cb7e9e942d4f6

Authored by Guenter Roeck
Committed by Greg Kroah-Hartman
1 parent e1adf6d7f0

next: sh: Fix compile error

commit 378af02b1aecabb3756e19c0cbb8cdd9c3b9637f upstream.

Commit 927609d622a3 ("kernel: tighten rules for ACCESS ONCE") results in a
compile failure for sh builds with CONFIG_X2TLB enabled.

arch/sh/mm/gup.c: In function 'gup_get_pte':
arch/sh/mm/gup.c:20:2: error: invalid initializer
make[1]: *** [arch/sh/mm/gup.o] Error 1

Replace ACCESS_ONCE with READ_ONCE to fix the problem.

Fixes: 927609d622a3 ("kernel: tighten rules for ACCESS ONCE")
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -17,7 +17,7 @@
17 17 static inline pte_t gup_get_pte(pte_t *ptep)
18 18 {
19 19 #ifndef CONFIG_X2TLB
20   - return ACCESS_ONCE(*ptep);
  20 + return READ_ONCE(*ptep);
21 21 #else
22 22 /*
23 23 * With get_user_pages_fast, we walk down the pagetables without