Skip to content

Commit 5a2b59d

Browse files
committed
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1a17fdc commit 5a2b59d

File tree

1 file changed

+6
-6
lines changed
  • arch/sparc/include/uapi/asm

1 file changed

+6
-6
lines changed

arch/sparc/include/uapi/asm/swab.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ static inline __u16 __arch_swab16p(const __u16 *addr)
99
{
1010
__u16 ret;
1111

12-
__asm__ __volatile__ ("lduha [%1] %2, %0"
12+
__asm__ __volatile__ ("lduha [%2] %3, %0"
1313
: "=r" (ret)
14-
: "r" (addr), "i" (ASI_PL));
14+
: "m" (*addr), "r" (addr), "i" (ASI_PL));
1515
return ret;
1616
}
1717
#define __arch_swab16p __arch_swab16p
@@ -20,9 +20,9 @@ static inline __u32 __arch_swab32p(const __u32 *addr)
2020
{
2121
__u32 ret;
2222

23-
__asm__ __volatile__ ("lduwa [%1] %2, %0"
23+
__asm__ __volatile__ ("lduwa [%2] %3, %0"
2424
: "=r" (ret)
25-
: "r" (addr), "i" (ASI_PL));
25+
: "m" (*addr), "r" (addr), "i" (ASI_PL));
2626
return ret;
2727
}
2828
#define __arch_swab32p __arch_swab32p
@@ -31,9 +31,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr)
3131
{
3232
__u64 ret;
3333

34-
__asm__ __volatile__ ("ldxa [%1] %2, %0"
34+
__asm__ __volatile__ ("ldxa [%2] %3, %0"
3535
: "=r" (ret)
36-
: "r" (addr), "i" (ASI_PL));
36+
: "m" (*addr), "r" (addr), "i" (ASI_PL));
3737
return ret;
3838
}
3939
#define __arch_swab64p __arch_swab64p

0 commit comments

Comments
 (0)