All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/powerpc: Adjust wild_bctr to build with old gcc
@ 2018-11-14 11:50 Gustavo Romero
  2018-11-15  2:33 ` [PATCH v2] " Gustavo Romero
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Romero @ 2018-11-14 11:50 UTC (permalink / raw)
  To: linuxppc-dev

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.

That patch adjusts the wild_bctr test so the type promotion to UL for the
shifts on compilation still happens 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>
---
 tools/testing/selftests/powerpc/mm/wild_bctr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9..7e56aa4 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,8 @@ 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)	(((REG_POISON+0UL) << 48) | ((n) << 32) | ((REG_POISON+0UL) << 16) | (n))
 
 static inline void poison_regs(void)
 {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] selftests/powerpc: Adjust wild_bctr to build with old gcc
  2018-11-14 11:50 [PATCH] selftests/powerpc: Adjust wild_bctr to build with old gcc Gustavo Romero
@ 2018-11-15  2:33 ` Gustavo Romero
  2018-11-15 13:25   ` [v2] " Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Romero @ 2018-11-15  2:33 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: gromero

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>
---
 tools/testing/selftests/powerpc/mm/wild_bctr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9..aadac172 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,8 @@ 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)
 {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [v2] selftests/powerpc: Adjust wild_bctr to build with old gcc
  2018-11-15  2:33 ` [PATCH v2] " Gustavo Romero
@ 2018-11-15 13:25   ` Michael Ellerman
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-11-15 13:25 UTC (permalink / raw)
  To: Gustavo Romero, linuxppc-dev; +Cc: gromero

On Thu, 2018-11-15 at 02:33:30 UTC, Gustavo Romero wrote:
> 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>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/b2fed34a628df6118b5d4e13f49a33

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-15 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 11:50 [PATCH] selftests/powerpc: Adjust wild_bctr to build with old gcc Gustavo Romero
2018-11-15  2:33 ` [PATCH v2] " Gustavo Romero
2018-11-15 13:25   ` [v2] " Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.