Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gustavo Romero and committed by
Michael Ellerman
b2fed34a 66f93c5a

+3 -2
+3 -2
tools/testing/selftests/powerpc/mm/wild_bctr.c
··· 47 47 return 0; 48 48 } 49 49 50 - #define REG_POISON 0x5a5aUL 51 - #define POISONED_REG(n) ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n)) 50 + #define REG_POISON 0x5a5a 51 + #define POISONED_REG(n) ((((unsigned long)REG_POISON) << 48) | ((n) << 32) | \ 52 + (((unsigned long)REG_POISON) << 16) | (n)) 52 53 53 54 static inline void poison_regs(void) 54 55 {