diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-22 12:40:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-22 12:40:53 -0400 |
commit | 02c502566ef505d0469fa27567f48766c1f5f7af (patch) | |
tree | dd29678eb5f15ddfe537418eb83ad2c54074c37b /tools/usb | |
parent | f06fc0c0de0b4f01dbad8ec5552e78192c7abbb8 (diff) | |
parent | a51f4047758d2bcd099ea113b833ed380f4024ba (diff) |
Merge branch 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/build changes from Ingo Molnar.
* 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86, build: Fix portability issues when cross-building
x86, tools: Remove unneeded header files from tools/build.c
USB: ffs-test: Don't duplicate {get,put}_unaligned*() functions
x86, efi: Fix endian issues and unaligned accesses
x86, boot: Restrict CFLAGS for hostprogs
x86, mkpiggy: Don't open code put_unaligned_le32()
x86, relocs: Don't open code put_unaligned_le32()
tools/include: Add byteshift headers for endian access
Diffstat (limited to 'tools/usb')
-rw-r--r-- | tools/usb/Makefile | 2 | ||||
-rw-r--r-- | tools/usb/ffs-test.c | 29 |
2 files changed, 2 insertions, 29 deletions
diff --git a/tools/usb/Makefile b/tools/usb/Makefile index 8b704af14349..396d6c44e9d7 100644 --- a/tools/usb/Makefile +++ b/tools/usb/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | CC = $(CROSS_COMPILE)gcc | 3 | CC = $(CROSS_COMPILE)gcc |
4 | PTHREAD_LIBS = -lpthread | 4 | PTHREAD_LIBS = -lpthread |
5 | WARNINGS = -Wall -Wextra | 5 | WARNINGS = -Wall -Wextra |
6 | CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) | 6 | CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) -I../include |
7 | 7 | ||
8 | all: testusb ffs-test | 8 | all: testusb ffs-test |
9 | %: %.c | 9 | %: %.c |
diff --git a/tools/usb/ffs-test.c b/tools/usb/ffs-test.c index 53452c35d5e1..4b107b5e623f 100644 --- a/tools/usb/ffs-test.c +++ b/tools/usb/ffs-test.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <sys/stat.h> | 36 | #include <sys/stat.h> |
37 | #include <sys/types.h> | 37 | #include <sys/types.h> |
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | #include <tools/le_byteshift.h> | ||
39 | 40 | ||
40 | #include "../../include/linux/usb/functionfs.h" | 41 | #include "../../include/linux/usb/functionfs.h" |
41 | 42 | ||
@@ -47,34 +48,6 @@ | |||
47 | #define le32_to_cpu(x) le32toh(x) | 48 | #define le32_to_cpu(x) le32toh(x) |
48 | #define le16_to_cpu(x) le16toh(x) | 49 | #define le16_to_cpu(x) le16toh(x) |
49 | 50 | ||
50 | static inline __u16 get_unaligned_le16(const void *_ptr) | ||
51 | { | ||
52 | const __u8 *ptr = _ptr; | ||
53 | return ptr[0] | (ptr[1] << 8); | ||
54 | } | ||
55 | |||
56 | static inline __u32 get_unaligned_le32(const void *_ptr) | ||
57 | { | ||
58 | const __u8 *ptr = _ptr; | ||
59 | return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24); | ||
60 | } | ||
61 | |||
62 | static inline void put_unaligned_le16(__u16 val, void *_ptr) | ||
63 | { | ||
64 | __u8 *ptr = _ptr; | ||
65 | *ptr++ = val; | ||
66 | *ptr++ = val >> 8; | ||
67 | } | ||
68 | |||
69 | static inline void put_unaligned_le32(__u32 val, void *_ptr) | ||
70 | { | ||
71 | __u8 *ptr = _ptr; | ||
72 | *ptr++ = val; | ||
73 | *ptr++ = val >> 8; | ||
74 | *ptr++ = val >> 16; | ||
75 | *ptr++ = val >> 24; | ||
76 | } | ||
77 | |||
78 | 51 | ||
79 | /******************** Messages and Errors ***********************************/ | 52 | /******************** Messages and Errors ***********************************/ |
80 | 53 | ||