summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2018-02-25 10:21:31 +0000
committerhselasky <hselasky@FreeBSD.org>2018-02-25 10:21:31 +0000
commit46bfe7c04b6f3eb3e260dfcea8b2b0aa62720cd7 (patch)
treefddb91e794d0bc1965cf96b157077d7ec596f950
parentc1c8be2caba87b30fb7698b3b1072e10334cbf19 (diff)
downloadFreeBSD-src-46bfe7c04b6f3eb3e260dfcea8b2b0aa62720cd7.zip
FreeBSD-src-46bfe7c04b6f3eb3e260dfcea8b2b0aa62720cd7.tar.gz
MFC r329447:
Compile in the LinuxKPI. Flexible array members are not allowed in a union. Use a zero length array instead. Reported by: jbeich@ Sponsored by: Mellanox Technologies
-rw-r--r--sys/compat/linuxkpi/common/include/asm/atomic.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/linuxkpi/common/include/asm/atomic.h b/sys/compat/linuxkpi/common/include/asm/atomic.h
index 8ff0184..3323e7d 100644
--- a/sys/compat/linuxkpi/common/include/asm/atomic.h
+++ b/sys/compat/linuxkpi/common/include/asm/atomic.h
@@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new)
#define cmpxchg(ptr, old, new) ({ \
union { \
__typeof(*(ptr)) val; \
- u8 u8[]; \
- u16 u16[]; \
- u32 u32[]; \
- u64 u64[]; \
+ u8 u8[0]; \
+ u16 u16[0]; \
+ u32 u32[0]; \
+ u64 u64[0]; \
} __ret = { .val = (old) }, __new = { .val = (new) }; \
\
CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \
OpenPOWER on IntegriCloud