]> Pileus Git - ~andy/linux/blobdiff - tools/usb/ffs-test.c
Merge branch 'i2c-embedded/for-3.4' of git://git.pengutronix.de/git/wsa/linux
[~andy/linux] / tools / usb / ffs-test.c
index b9c7986316997b4f820ed1567a71ff911ae3d107..4b107b5e623fff802df9e49065273e90661c83fe 100644 (file)
@@ -2,7 +2,7 @@
  * ffs-test.c.c -- user mode filesystem api for usb composite function
  *
  * Copyright (C) 2010 Samsung Electronics
- *                    Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
+ *                    Author: Michal Nazarewicz <mina86@mina86.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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 ***********************************/