All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: define __LITTLE_ENDIAN and __BIG_ENDIAN for math-emu
@ 2026-05-17  4:14 Mingcong Bai
  2026-05-17 13:54 ` David Laight
  0 siblings, 1 reply; 6+ messages in thread
From: Mingcong Bai @ 2026-05-17  4:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: Xi Ruoyao, Kexy Biscuit, Mingcong Bai, stable, kernel test robot,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), linuxppc-dev

Similar to commit b929926f01f2 ("sh: define __BIG_ENDIAN for math-emu"),
define __LITTLE_ENDIAN and __BIG_ENDIAN as 0 to mitigate build-time
warnings:

  ./include/math-emu/double.h:59:21: error: ‘__BIG_ENDIAN’ is not defined, evaluates to ‘0’ [-Werror=undef]
     59 | #if __BYTE_ORDER == __BIG_ENDIAN
        |

Cc: stable@vger.kernel.org
Fixes: 13da9e200fe4 ("Revert "endian: #define __BYTE_ORDER"")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507301656.7FEX6J5W-lkp@intel.com/
Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
---
 arch/powerpc/include/asm/sfp-machine.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index 8b957aabb826d..db8525605c026 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -319,10 +319,12 @@
 #define abort()								\
 	return 0
 
-#ifdef __BIG_ENDIAN
+#ifdef __BIG_ENDIAN__
 #define __BYTE_ORDER __BIG_ENDIAN
+#define __LITTLE_ENDIAN 0
 #else
 #define __BYTE_ORDER __LITTLE_ENDIAN
+#define __BIG_ENDIAN 0
 #endif
 
 /* Exception flags. */
-- 
2.52.0


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

end of thread, other threads:[~2026-05-20 22:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-17  4:14 [PATCH] powerpc: define __LITTLE_ENDIAN and __BIG_ENDIAN for math-emu Mingcong Bai
2026-05-17 13:54 ` David Laight
2026-05-17 15:40   ` Xi Ruoyao
2026-05-20 13:14   ` Christophe Leroy (CS GROUP)
2026-05-20 18:43     ` David Laight
2026-05-20 22:05       ` Christophe Leroy (CS GROUP)

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.