Skip to content

Commit

Permalink
m68k: Fix asm constraints for atomic_sub_and_test() and atomic_add_ne…
Browse files Browse the repository at this point in the history
…gative()

Recently, we started seeing this on allmodconfig builds:

  CC      mm/memcontrol.o
{standard input}: Assembler messages:
{standard input}:4076: Error: operands mismatch -- statement `subl 12(%fp),170(%a0)' ignored

Correct the asm constraint, like done for m68knommu.

Signed-off-by: Geert Uytterhoeven <[email protected]>
  • Loading branch information
geertu committed Apr 14, 2010
1 parent 1aac4ef commit b560177
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/m68k/include/asm/atomic_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,18 @@ static inline int atomic_xchg(atomic_t *v, int new)
static inline int atomic_sub_and_test(int i, atomic_t *v)
{
char c;
__asm__ __volatile__("subl %2,%1; seq %0" : "=d" (c), "+m" (*v): "g" (i));
__asm__ __volatile__("subl %2,%1; seq %0"
: "=d" (c), "+m" (*v)
: "id" (i));
return c != 0;
}

static inline int atomic_add_negative(int i, atomic_t *v)
{
char c;
__asm__ __volatile__("addl %2,%1; smi %0" : "=d" (c), "+m" (*v): "g" (i));
__asm__ __volatile__("addl %2,%1; smi %0"
: "=d" (c), "+m" (*v)
: "id" (i));
return c != 0;
}

Expand Down

0 comments on commit b560177

Please sign in to comment.