]> Pileus Git - ~andy/linux/blobdiff - tools/usb/ffs-test.c
Merge branch 'amba' of git://git.linaro.org/people/rmk/linux-arm
[~andy/linux] / tools / usb / ffs-test.c
index 53452c35d5e18e0352f54506c3fad51edd9e7686..4b107b5e623fff802df9e49065273e90661c83fe 100644 (file)
@@ -36,6 +36,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <tools/le_byteshift.h>
 
 #include "../../include/linux/usb/functionfs.h"
 
 #define le32_to_cpu(x)  le32toh(x)
 #define le16_to_cpu(x)  le16toh(x)
 
-static inline __u16 get_unaligned_le16(const void *_ptr)
-{
-       const __u8 *ptr = _ptr;
-       return ptr[0] | (ptr[1] << 8);
-}
-
-static inline __u32 get_unaligned_le32(const void *_ptr)
-{
-       const __u8 *ptr = _ptr;
-       return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
-}
-
-static inline void put_unaligned_le16(__u16 val, void *_ptr)
-{
-       __u8 *ptr = _ptr;
-       *ptr++ = val;
-       *ptr++ = val >> 8;
-}
-
-static inline void put_unaligned_le32(__u32 val, void *_ptr)
-{
-       __u8 *ptr = _ptr;
-       *ptr++ = val;
-       *ptr++ = val >>  8;
-       *ptr++ = val >> 16;
-       *ptr++ = val >> 24;
-}
-
 
 /******************** Messages and Errors ***********************************/