[PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition

Philippe Mathieu-Daudé posted 2 patches 1 month, 2 weeks ago
[PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
Invert target_needs_bswap() comparison to match the
COMPILING_PER_TARGET definition (2 lines upper).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20241004162118.84570-2-philmd@linaro.org>
---
 include/exec/tswap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index b7a41913475..ecd4faef015 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -28,7 +28,7 @@ bool target_words_bigendian(void);
 #ifdef COMPILING_PER_TARGET
 #define target_needs_bswap()  (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)
 #else
-#define target_needs_bswap()  (target_words_bigendian() != HOST_BIG_ENDIAN)
+#define target_needs_bswap()  (HOST_BIG_ENDIAN != target_words_bigendian())
 #endif /* COMPILING_PER_TARGET */
 
 static inline uint16_t tswap16(uint16_t s)
-- 
2.45.2


Re: [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition
Posted by Richard Henderson 1 month, 1 week ago
On 10/10/24 10:52, Philippe Mathieu-Daudé wrote:
> Invert target_needs_bswap() comparison to match the
> COMPILING_PER_TARGET definition (2 lines upper).
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20241004162118.84570-2-philmd@linaro.org>
> ---
>   include/exec/tswap.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/include/exec/tswap.h b/include/exec/tswap.h
> index b7a41913475..ecd4faef015 100644
> --- a/include/exec/tswap.h
> +++ b/include/exec/tswap.h
> @@ -28,7 +28,7 @@ bool target_words_bigendian(void);
>   #ifdef COMPILING_PER_TARGET
>   #define target_needs_bswap()  (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)
>   #else
> -#define target_needs_bswap()  (target_words_bigendian() != HOST_BIG_ENDIAN)
> +#define target_needs_bswap()  (HOST_BIG_ENDIAN != target_words_bigendian())
>   #endif /* COMPILING_PER_TARGET */
>   
>   static inline uint16_t tswap16(uint16_t s)