__get_unaligned can't cope with const-qualified types:
drivers/char/vc_screen.c: In function 'vcs_write':
drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
Signed-off-by: Andreas Schwab <[email protected]>
--- linux-2.6.14/include/asm-generic/unaligned.h.~1~ 2005-10-28 02:02:08.000000000 +0200
+++ linux-2.6.14/include/asm-generic/unaligned.h 2005-11-10 14:37:58.356107194 +0100
@@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u
#define __get_unaligned(ptr, size) ({ \
const void *__gu_p = ptr; \
- __typeof__(*(ptr)) val; \
+ unsigned long val; \
switch (size) { \
case 1: \
val = *(const __u8 *)__gu_p; \
@@ -95,7 +95,7 @@ static inline void __ustw(__u16 val, __u
default: \
bad_unaligned_access_length(); \
}; \
- val; \
+ (__typeof__(*(ptr)))val; \
})
#define __put_unaligned(val, ptr, size) \
Andreas.
--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
On Thu, Nov 10, 2005 at 03:42:05PM +0100, Andreas Schwab wrote:
> __get_unaligned can't cope with const-qualified types:
>
> drivers/char/vc_screen.c: In function 'vcs_write':
> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
What if get_unaligned is used with a u64 / long long type (which it is)?
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
Russell King <[email protected]> writes:
> On Thu, Nov 10, 2005 at 03:42:05PM +0100, Andreas Schwab wrote:
>> __get_unaligned can't cope with const-qualified types:
>>
>> drivers/char/vc_screen.c: In function 'vcs_write':
>> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
>> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
>> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
>> drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'
>
> What if get_unaligned is used with a u64 / long long type (which it is)?
Oops, I missed that, it needs a different approach.
Andreas.
--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."