[v3,11/15] bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
diff mbox series

Message ID 20190313170657.16688-12-ncopa@alpinelinux.org
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • Build fixes for musl libc
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Natanael Copa March 13, 2019, 5:06 p.m. UTC
There is no standard saying that __WORDSIZE should be be defined or in
what include it should be defined. Use a portable way to detect 64 bit
environment.

This fixes a warning when building with musl libc:

 warning: "__WORDSIZE" is not defined, evaluates to 0 [-Wundef]

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 drivers/bus/dpaa/include/fsl_qman.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Monjalon March 30, 2019, 10:36 p.m. UTC | #1
13/03/2019 18:06, Natanael Copa:
> There is no standard saying that __WORDSIZE should be be defined or in
> what include it should be defined. Use a portable way to detect 64 bit
> environment.
> 
> This fixes a warning when building with musl libc:
> 
>  warning: "__WORDSIZE" is not defined, evaluates to 0 [-Wundef]
> 
> Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> ---
[...]
> -#if (__WORDSIZE == 64)
> +#if (ULONG_MAX == 0xffffffffffffffff)

There is a more explicit config in DPDK: RTE_ARCH_64

Patch
diff mbox series

diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index e43841499..7f3f40d49 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -11,11 +11,12 @@ 
 extern "C" {
 #endif
 
+#include <limits.h>
 #include <dpaa_rbtree.h>
 #include <rte_eventdev.h>
 
 /* FQ lookups (turn this on for 64bit user-space) */
-#if (__WORDSIZE == 64)
+#if (ULONG_MAX == 0xffffffffffffffff)
 #define CONFIG_FSL_QMAN_FQ_LOOKUP
 /* if FQ lookups are supported, this controls the number of initialised,
  * s/w-consumed FQs that can be supported at any one time.