]> git.baikalelectronics.ru Git - kernel.git/commit
m68k: Fix asm register constraints for atomic ops
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 9 Aug 2021 11:29:03 +0000 (13:29 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 23 Aug 2021 11:23:57 +0000 (13:23 +0200)
commit666558b3aa7f5f8e536b6bb910e1093f7c3b8fe8
treec3ec002c236f66c9f0b7ad110b840de8a8bfab44
parentf930bcc8f9c2162f1272c8131dfa5c5fba6998c4
m68k: Fix asm register constraints for atomic ops

Depending on register assignment by the compiler:

    {standard input}:3084: Error: operands mismatch -- statement `andl %a1,%d1' ignored
    {standard input}:3145: Error: operands mismatch -- statement `orl %a1,%d1' ignored
    {standard input}:3195: Error: operands mismatch -- statement `eorl %a1,%d1' ignored

Indeed, the first operand must not be an address register.  However, it
can be an immediate value.  Fix this by adjusting the register
constraint from "g" (general purpose register) to "di" (data register or
immediate).

Fixes: d61c8ed2a41d2d3c ("locking/atomic, arch/m68k: Implement atomic_fetch_{add,sub,and,or,xor}()")
Fixes: cde7147d9896a143 ("locking,arch,m68k: Fold atomic_ops")
Fixes: 1da177e4c3f41524 ("Linux-2.6.12-rc2")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210809112903.3898660-1-geert@linux-m68k.org
arch/m68k/include/asm/atomic.h