aboutsummaryrefslogtreecommitdiff
path: root/include/linux/byteorder/swab.h
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-11-26 14:57:05 +0100
committerStefan Roese <sr@denx.de>2021-12-19 09:50:47 +0100
commit52a26d392a45511fb5432c77d99cd3fa93c44e76 (patch)
treef4ed7dc3cd2de7e4d7fbc8f71f2fbd5473d8a1b2 /include/linux/byteorder/swab.h
parent4ee7dfba2feef4a36016cde60a04cac3c97e4d14 (diff)
downloadu-boot-52a26d392a45511fb5432c77d99cd3fa93c44e76.zip
u-boot-52a26d392a45511fb5432c77d99cd3fa93c44e76.tar.gz
u-boot-52a26d392a45511fb5432c77d99cd3fa93c44e76.tar.bz2
include/linux/byteorder: Fix compilation of __constant_cpu_to_be32()
The macro __constant_cpu_to_be32() uses ___constant_swab32(), which for some reason is not defined and causes the following error during compilation: include/linux/byteorder/little_endian.h:28:52: warning: implicit declaration of function ‘___constant_swab32’; did you mean ‘__builtin_bswap32’? [-Wimplicit-function-declaration] #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x))) Declare all ___constant_swabXX() macros. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include/linux/byteorder/swab.h')
-rw-r--r--include/linux/byteorder/swab.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h
index 4334fa7..5efc252 100644
--- a/include/linux/byteorder/swab.h
+++ b/include/linux/byteorder/swab.h
@@ -39,6 +39,10 @@
(__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
(__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+#define ___constant_swab16(x) ___swab16(x)
+#define ___constant_swab32(x) ___swab32(x)
+#define ___constant_swab64(x) ___swab64(x)
+
/*
* provide defaults when no architecture-specific optimization is detected
*/