summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/unaligned.h
diff options
context:
space:
mode:
authorAtsushi Nemoto2006-03-08 06:55:28 +0100
committerLinus Torvalds2006-03-08 23:14:00 +0100
commit707ced0d718e89b52b13aa55a64653083e792cca (patch)
tree3b3276325c3ad5a1de5205971ae6367eb890a426 /include/asm-generic/unaligned.h
parent[PATCH] idle threads should have a sane ->timestamp value (diff)
downloadkernel-qcow2-linux-707ced0d718e89b52b13aa55a64653083e792cca.tar.gz
kernel-qcow2-linux-707ced0d718e89b52b13aa55a64653083e792cca.tar.xz
kernel-qcow2-linux-707ced0d718e89b52b13aa55a64653083e792cca.zip
[PATCH] __get_unaligned() gcc-4 fix
If the 'ptr' is a const, this code cause "assignment of read-only variable" error on gcc 4.x. Use __u64 instead of __typeof__(*(ptr)) for temporary variable to get rid of errors on gcc 4.x. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-generic/unaligned.h')
-rw-r--r--include/asm-generic/unaligned.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index 4dc8ddb401c1..09ec447fe2af 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u16 *addr)
#define __get_unaligned(ptr, size) ({ \
const void *__gu_p = ptr; \
- __typeof__(*(ptr)) val; \
+ __u64 val; \
switch (size) { \
case 1: \
val = *(const __u8 *)__gu_p; \
@@ -95,7 +95,7 @@ static inline void __ustw(__u16 val, __u16 *addr)
default: \
bad_unaligned_access_length(); \
}; \
- val; \
+ (__typeof__(*(ptr)))val; \
})
#define __put_unaligned(val, ptr, size) \