diff options
author | Joel Stanley <joel@jms.id.au> | 2017-09-20 16:56:57 +0930 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2017-09-22 12:16:19 +1000 |
commit | 77158819158d1d7053a737ac090d04fdfbfe9265 (patch) | |
tree | 4246a8ef9ec13c70f82ffef2e43018659d631dad /libpdbg/device.c | |
parent | 908c6512c59b56198a58410de266691a066d0002 (diff) | |
download | pdbg-77158819158d1d7053a737ac090d04fdfbfe9265.tar.gz pdbg-77158819158d1d7053a737ac090d04fdfbfe9265.zip |
device: remove use of ccan's endian
When cross compiling with uclibc under buildroot, we get the following
clash:
./ccan/endian/endian.h:84:24: error: redefinition of ‘__bswap_32’
static inline uint32_t bswap_32(uint32_t val)
^
In file included from usr/include/bits/byteswap.h:1:0,
from usr/include/byteswap.h:22,
from usr/include/endian.h:59,
from usr/include/bits/pthreadtypes.h:21,
from usr/include/bits/uClibc_stdio.h:92,
from usr/include/stdio.h:71,
from libpdbg/device.c:18:
usr/include/bits/byteswap-common.h:44:1: note: previous definition of ‘__bswap_32’ was here
__bswap_32 (unsigned int __bsx)
^~~~~~~~~~
Work around it by not using ccan's endian. There's only one call site, and we
can use a libc function instead.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'libpdbg/device.c')
-rw-r--r-- | libpdbg/device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpdbg/device.c b/libpdbg/device.c index 95abe52..dbbe42f 100644 --- a/libpdbg/device.c +++ b/libpdbg/device.c @@ -21,7 +21,7 @@ #include <libfdt/libfdt.h> #include <libfdt/libfdt_internal.h> #include <ccan/str/str.h> -#include <ccan/endian/endian.h> +#include <endian.h> #undef PR_DEBUG #define PR_DEBUG(...) @@ -838,7 +838,7 @@ u64 dt_get_number(const void *pdata, unsigned int cells) u64 ret = 0; while(cells--) - ret = (ret << 32) | be32_to_cpu(*(p++)); + ret = (ret << 32) | be32toh(*(p++)); return ret; } |