Fix wrong endian conversion macro 75/221475/1 accepted/tizen/unified/20200103.050122 submit/tizen/20200103.031601
authorSemun Lee <semun.lee@samsung.com>
Fri, 3 Jan 2020 02:11:22 +0000 (11:11 +0900)
committerSemun Lee <semun.lee@samsung.com>
Fri, 3 Jan 2020 02:11:22 +0000 (11:11 +0900)
Change-Id: Id7130b79739cd8ba6f9271f28db18d7b6a0baa79
Signed-off-by: Semun Lee <semun.lee@samsung.com>
include/transport/mtp_descs_strings.h

index 26cf650..9e340f5 100644 (file)
@@ -28,10 +28,15 @@ enum functionfs_flags {
 };
 #endif
 
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define cpu_to_le16(x)  (x)
+#define cpu_to_le32(x)  (x)
+#else
 #define cpu_to_le16(x)  ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
 #define cpu_to_le32(x)  \
        ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >>  8) | \
        (((x) & 0x0000ff00u) <<  8) | (((x) & 0x000000ffu) << 24))
+#endif
 #define le32_to_cpu(x)  le32toh(x)
 #define le16_to_cpu(x)  le16toh(x)