path: root/arch/avr32/include
diff options
authorMans Rullgard <>2016-03-10 14:23:49 +0000
committerHans-Christian Egtvedt <>2016-03-14 11:08:29 +0100
commit392c5174499296bcdecbe1705d577883065fa5de (patch)
tree2d649694002b4e9ba45d3a67393954d402636682 /arch/avr32/include
parentb837e97fd35a6b551e3478ace0623a0bd744787c (diff)
avr32: fix asm operand constraint in cmpxchg()
If the 'old' operand to cmpxchg() is a constant wider than 21 bits, linking fails with a "relocation truncated to fit: R_AVR32_21S" error. Fix this by replacing the "i" constraint with "Ks21" which makes the compiler use a temporary register for out of range constants. Signed-off-by: Mans Rullgard <> Acked-by: Hans-Christian Noren Egtvedt <> Tested-by: Andy Shevchenko <> Tested-by: Sudip Mukherjee <>
Diffstat (limited to 'arch/avr32/include')
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/avr32/include/asm/cmpxchg.h b/arch/avr32/include/asm/cmpxchg.h
index 366bbea..572739b 100644
--- a/arch/avr32/include/asm/cmpxchg.h
+++ b/arch/avr32/include/asm/cmpxchg.h
@@ -57,7 +57,7 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
" brne 1b\n"
: [ret] "=&r"(ret), [m] "=m"(*m)
- : "m"(m), [old] "ir"(old), [new] "r"(new)
+ : "m"(m), [old] "Ks21r"(old), [new] "r"(new)
: "memory", "cc");
return ret;