From: Andreas Schwab <schwab@suse.de>
To: linux-kernel@vger.kernel.org
Subject: Broken __get_unaligned from <asm-generic/unaligned.h>
Date: Thu, 10 Nov 2005 15:42:05 +0100 [thread overview]
Message-ID: <jevez0h8ea.fsf@sykes.suse.de> (raw)
__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 <schwab@suse.de>
--- 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, schwab@suse.de
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."
next reply other threads:[~2005-11-10 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-10 14:42 Andreas Schwab [this message]
2005-11-10 14:48 ` Broken __get_unaligned from <asm-generic/unaligned.h> Russell King
2005-11-10 16:20 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jevez0h8ea.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox