Move the be32_to_cpu() definition

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 <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Bart Van Assche 2022-04-21 15:18:19 -07:00 committed by Jaegeuk Kim
parent 1612bf99de
commit cdefef0d07
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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) \