[v3,11/15] bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0
Checks
Commit Message
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
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
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
@@ -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.