Commit 5a2b59d3993e8ca4f7788a48a23e5cb303f26954
1 parent
1a17fdc4f4
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
sparc64: Fix constraints on swab helpers.
We are reading the memory location, so we have to have a memory constraint in there purely for the sake of showing the data flow to the compiler. Reported-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff
arch/sparc/include/uapi/asm/swab.h
... | ... | @@ -9,9 +9,9 @@ |
9 | 9 | { |
10 | 10 | __u16 ret; |
11 | 11 | |
12 | - __asm__ __volatile__ ("lduha [%1] %2, %0" | |
12 | + __asm__ __volatile__ ("lduha [%2] %3, %0" | |
13 | 13 | : "=r" (ret) |
14 | - : "r" (addr), "i" (ASI_PL)); | |
14 | + : "m" (*addr), "r" (addr), "i" (ASI_PL)); | |
15 | 15 | return ret; |
16 | 16 | } |
17 | 17 | #define __arch_swab16p __arch_swab16p |
18 | 18 | |
... | ... | @@ -20,9 +20,9 @@ |
20 | 20 | { |
21 | 21 | __u32 ret; |
22 | 22 | |
23 | - __asm__ __volatile__ ("lduwa [%1] %2, %0" | |
23 | + __asm__ __volatile__ ("lduwa [%2] %3, %0" | |
24 | 24 | : "=r" (ret) |
25 | - : "r" (addr), "i" (ASI_PL)); | |
25 | + : "m" (*addr), "r" (addr), "i" (ASI_PL)); | |
26 | 26 | return ret; |
27 | 27 | } |
28 | 28 | #define __arch_swab32p __arch_swab32p |
29 | 29 | |
... | ... | @@ -31,9 +31,9 @@ |
31 | 31 | { |
32 | 32 | __u64 ret; |
33 | 33 | |
34 | - __asm__ __volatile__ ("ldxa [%1] %2, %0" | |
34 | + __asm__ __volatile__ ("ldxa [%2] %3, %0" | |
35 | 35 | : "=r" (ret) |
36 | - : "r" (addr), "i" (ASI_PL)); | |
36 | + : "m" (*addr), "r" (addr), "i" (ASI_PL)); | |
37 | 37 | return ret; |
38 | 38 | } |
39 | 39 | #define __arch_swab64p __arch_swab64p |