Move the be32_to_cpu() definition next to the little endian conversion
functions. This patch improves portability since the MinGW ntohl()
function exists in another library than the C library.

Signed-off-by: Bart Van Assche <bvanass...@acm.org>
---
 fsck/quotaio.h    | 2 --
 include/f2fs_fs.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fsck/quotaio.h b/fsck/quotaio.h
index 999e800f82c7..0024fe570727 100644
--- a/fsck/quotaio.h
+++ b/fsck/quotaio.h
@@ -197,8 +197,6 @@ struct quotafile_ops {
 #define __force
 #endif
 
-#define be32_to_cpu(n) ntohl(n)
-
 /* Open existing quotafile of given type (and verify its format) on given
  * filesystem. */
 errcode_t quota_file_open(struct f2fs_sb_info *sbi, struct quota_handle *h,
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 49438eb2e6f2..60b6dfced74b 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -194,6 +194,7 @@ static inline uint64_t bswap_64(uint64_t val)
 #define cpu_to_le16(x) ((uint16_t)(x))
 #define cpu_to_le32(x) ((uint32_t)(x))
 #define cpu_to_le64(x) ((uint64_t)(x))
+#define be32_to_cpu(x) __builtin_bswap64(x)
 #elif __BYTE_ORDER == __BIG_ENDIAN
 #define le16_to_cpu(x) bswap_16(x)
 #define le32_to_cpu(x) bswap_32(x)
@@ -201,6 +202,7 @@ static inline uint64_t bswap_64(uint64_t val)
 #define cpu_to_le16(x) bswap_16(x)
 #define cpu_to_le32(x) bswap_32(x)
 #define cpu_to_le64(x) bswap_64(x)
+#define be32_to_cpu(x) ((uint64_t)(x))
 #endif
 
 #define typecheck(type,x) \


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to