diff options
author | Rostislav Skudnov <rostislav@tuxera.com> | 2018-01-23 08:08:18 +0000 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2018-01-24 12:01:22 +0800 |
commit | 53b8b92652aa80e4e74345c109f43e390ebb0fe9 (patch) | |
tree | 032e4c361ce0c625a510d35637d05cb1622ed44d | |
parent | 57b7c3bac421bae78e8297ecb5f2eca3daf16493 (diff) | |
download | xfstests-53b8b92652aa80e4e74345c109f43e390ebb0fe9.tar.gz |
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 <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
-rw-r--r-- | src/fssum.c | 9 |
1 files 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 <netinet/in.h> #include <inttypes.h> #include <assert.h> +#include <endian.h> #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)); } |