summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/powerpc/mm/wild_bctr.c
diff options
context:
space:
mode:
authorGustavo Romero <gromero@linux.vnet.ibm.com>2018-11-15 05:33:30 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-11-15 15:05:17 +0300
commitb2fed34a628df6118b5d4e13f49a33e15f704fa9 (patch)
tree68d7941711d7660c65a51dd48d6025d726268f34 /tools/testing/selftests/powerpc/mm/wild_bctr.c
parent66f93c5a02d5ba6ef17fef459143961382593212 (diff)
downloadlinux-b2fed34a628df6118b5d4e13f49a33e15f704fa9.tar.xz
selftests/powerpc: Adjust wild_bctr to build with old binutils
Currently the selftest wild_bctr can fail to build when an old gcc is used, notably on gcc using a binutils version <= 2.27, because the assembler does not support the integer suffix UL. This patch adjusts the wild_bctr test so the REG_POISON value is still treated as an unsigned long for the shifts on compilation but the UL suffix is absent on the stringification, so the inline asm code generated has no UL suffixes. Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com> [mpe: Wrap long line] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/mm/wild_bctr.c')
-rw-r--r--tools/testing/selftests/powerpc/mm/wild_bctr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9e49d4..f2fa101c5a6a 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,9 @@ static int ok(void)
return 0;
}
-#define REG_POISON 0x5a5aUL
-#define POISONED_REG(n) ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n))
+#define REG_POISON 0x5a5a
+#define POISONED_REG(n) ((((unsigned long)REG_POISON) << 48) | ((n) << 32) | \
+ (((unsigned long)REG_POISON) << 16) | (n))
static inline void poison_regs(void)
{