Skip to contentSkip to conversation

next: sh: Fix compile error

PATCH Applied Guenter Roeck 3 participants 3 messages Jan 7, 2015 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 next: sh: Fix compile error

Commit a91ed664749c ("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 a91ed664749c ("kernel: tighten rules for ACCESS ONCE")
Cc Paul E. McKenney <[email protected]>
Cc Christian Borntraeger <[email protected]>

---
Compile tested only.

 arch/sh/mm/gup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/mm/gup.c +1 -1
index 37458f3..e113bb4 100644
@@ -17,7 +17,7 @@
 static inline pte_t gup_get_pte(pte_t *ptep)
 {
 #ifndef CONFIG_X2TLB
-	return ACCESS_ONCE(*ptep);
+	return READ_ONCE(*ptep);
 #else
 	/*
 	 * With get_user_pages_fast, we walk down the pagetables without
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Guenter Roeck

Commit a91ed664749c ("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 a91ed664749c ("kernel: tighten rules for ACCESS ONCE")
Cc Paul E. McKenney <[email protected]>
Quoted 24 lines
Cc Christian Borntraeger <[email protected]>

---
Compile tested only.

 arch/sh/mm/gup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/mm/gup.c +1 -1
index 37458f3..e113bb4 100644
@@ -17,7 +17,7 @@
 static inline pte_t gup_get_pte(pte_t *ptep)
 {
 #ifndef CONFIG_X2TLB
-	return ACCESS_ONCE(*ptep);
+	return READ_ONCE(*ptep);
 #else
 	/*
 	 * With get_user_pages_fast, we walk down the pagetables without
Signature · 1 line
2.1.0
#2 lore raw

Am 07.01.2015 um 22:04 schrieb Paul E. McKenney:

Quoted 8 lines · Guenter Roeck
Quoted 7 lines

Commit a91ed664749c ("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

Quoted 6 lines
Quoted 4 lines

Replace ACCESS_ONCE with READ_ONCE to fix the problem.

Fixes a91ed664749c ("kernel: tighten rules for ACCESS ONCE")
Cc Paul E. McKenney <[email protected]>

Applied to my tree, thanks.

Christian