Re: drivers/video/riva/fbdev.c broken on x86_64
From: Andrew Morton
Date: Fri May 14 2004 - 20:14:22 EST
Andreas Schwab <schwab@xxxxxxx> wrote:
>
> for (i = 0; i < h; i++) {
> > -> b = *((u32 *)data);
> > b = (u32)((u32 *)b + 1);
> > -> m = *((u32 *)mask);
> > m = (u32)((u32 *)m + 1);
>
> It appears that someone tried to fix the use of cast as lvalue and failed
> miserably.
That would be me.
How about we simplify things a bit?
---
25-akpm/drivers/video/riva/fbdev.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff -puN drivers/video/riva/fbdev.c~fbdev-lval-fix drivers/video/riva/fbdev.c
--- 25/drivers/video/riva/fbdev.c~fbdev-lval-fix Fri May 14 16:34:10 2004
+++ 25-akpm/drivers/video/riva/fbdev.c Fri May 14 16:35:32 2004
@@ -492,17 +492,17 @@ static inline void reverse_order(u32 *l)
* CALLED FROM:
* rivafb_cursor()
*/
-static void rivafb_load_cursor_image(struct riva_par *par, u8 *data,
- u8 *mask, u16 bg, u16 fg, u32 w, u32 h)
+static void rivafb_load_cursor_image(struct riva_par *par, u8 *data8,
+ u8 *mask8, u16 bg, u16 fg, u32 w, u32 h)
{
int i, j, k = 0;
u32 b, m, tmp;
+ u32 *data = (u32 *)data8;
+ u32 *mask = (u32 *)mask8;
for (i = 0; i < h; i++) {
- b = *((u32 *)data);
- b = (u32)((u32 *)b + 1);
- m = *((u32 *)mask);
- m = (u32)((u32 *)m + 1);
+ b = *data++;
+ m = *mask++;
reverse_order(&b);
for (j = 0; j < w/2; j++) {
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/