[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>
---
This was not really a compile error but the warning looked scary enough.
There are various alternative ways to detect 64bit user-space at compile time,
but this is the most portable way I think.
drivers/bus/dpaa/include/fsl_qman.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -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.