diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:37:58 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:37:58 -0400 |
| commit | 5a2cec83a9bb1b4295aa8ab728fcb8ca1811a33c (patch) | |
| tree | 2f83dc6949763e77cf6422e696dc6146684dcf4e /include/asm-generic/unaligned.h | |
| parent | f2c853bca542f5ac0b036377637192a74f2091c2 (diff) | |
| parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) | |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/asm-generic/unaligned.h')
| -rw-r--r-- | include/asm-generic/unaligned.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 6c90f0f36eec..4dc8ddb401c1 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h | |||
| @@ -16,9 +16,9 @@ | |||
| 16 | * The main single-value unaligned transfer routines. | 16 | * The main single-value unaligned transfer routines. |
| 17 | */ | 17 | */ |
| 18 | #define get_unaligned(ptr) \ | 18 | #define get_unaligned(ptr) \ |
| 19 | ((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr)))) | 19 | __get_unaligned((ptr), sizeof(*(ptr))) |
| 20 | #define put_unaligned(x,ptr) \ | 20 | #define put_unaligned(x,ptr) \ |
| 21 | __put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) | 21 | __put_unaligned((__u64)(x), (ptr), sizeof(*(ptr))) |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * This function doesn't actually exist. The idea is that when | 24 | * This function doesn't actually exist. The idea is that when |
| @@ -36,19 +36,19 @@ struct __una_u16 { __u16 x __attribute__((packed)); }; | |||
| 36 | * Elemental unaligned loads | 36 | * Elemental unaligned loads |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | static inline unsigned long __uldq(const __u64 *addr) | 39 | static inline __u64 __uldq(const __u64 *addr) |
| 40 | { | 40 | { |
| 41 | const struct __una_u64 *ptr = (const struct __una_u64 *) addr; | 41 | const struct __una_u64 *ptr = (const struct __una_u64 *) addr; |
| 42 | return ptr->x; | 42 | return ptr->x; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | static inline unsigned long __uldl(const __u32 *addr) | 45 | static inline __u32 __uldl(const __u32 *addr) |
| 46 | { | 46 | { |
| 47 | const struct __una_u32 *ptr = (const struct __una_u32 *) addr; | 47 | const struct __una_u32 *ptr = (const struct __una_u32 *) addr; |
| 48 | return ptr->x; | 48 | return ptr->x; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | static inline unsigned long __uldw(const __u16 *addr) | 51 | static inline __u16 __uldw(const __u16 *addr) |
| 52 | { | 52 | { |
| 53 | const struct __una_u16 *ptr = (const struct __una_u16 *) addr; | 53 | const struct __una_u16 *ptr = (const struct __una_u16 *) addr; |
| 54 | return ptr->x; | 54 | return ptr->x; |
| @@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u16 *addr) | |||
| 78 | 78 | ||
| 79 | #define __get_unaligned(ptr, size) ({ \ | 79 | #define __get_unaligned(ptr, size) ({ \ |
| 80 | const void *__gu_p = ptr; \ | 80 | const void *__gu_p = ptr; \ |
| 81 | unsigned long val; \ | 81 | __typeof__(*(ptr)) val; \ |
| 82 | switch (size) { \ | 82 | switch (size) { \ |
| 83 | case 1: \ | 83 | case 1: \ |
| 84 | val = *(const __u8 *)__gu_p; \ | 84 | val = *(const __u8 *)__gu_p; \ |
