From 53b8b92652aa80e4e74345c109f43e390ebb0fe9 Mon Sep 17 00:00:00 2001 From: Rostislav Skudnov Date: Tue, 23 Jan 2018 08:08:18 +0000 Subject: src/fssum: Use htobe64() instead of a custom macro Remove unnecessary htonll() macro definition. Macros and functions starting with two underscores are usually internal and shouldn't be used by applications when a version without "__" is available. Signed-off-by: Rostislav Skudnov Reviewed-by: Christoph Hellwig Signed-off-by: Eryu Guan --- src/fssum.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/fssum.c b/src/fssum.c index 13111d6fef..2eaa236a6d 100644 --- a/src/fssum.c +++ b/src/fssum.c @@ -40,6 +40,7 @@ #include #include #include +#include #define CS_SIZE 16 #define CHUNKS 128 @@ -49,12 +50,6 @@ #define SEEK_DATA 3 #define SEEK_HOLE 4 #endif - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define htonll(x) __bswap_64 (x) -#else -#define htonll(x) (x) -#endif #endif /* TODO: add hardlink recognition */ @@ -216,7 +211,7 @@ sum_add_sum(sum_t *dst, sum_t *src) void sum_add_u64(sum_t *dst, uint64_t val) { - uint64_t v = htonll(val); + uint64_t v = htobe64(val); sum_add(dst, &v, sizeof(v)); } -- cgit 1.2.3-korg