Re: drivers/video/riva/fbdev.c broken on x86_64

From: Andreas Schwab
Date: Fri May 14 2004 - 16:28:55 EST


"J. Ryan Earl" <heretic@xxxxxxxxxx> writes:

> static void rivafb_load_cursor_image(struct riva_par *par, u8 *data,
> u8 *mask, u16 bg, u16 fg, u32 w, u32 h)
> {
> int i, j, k = 0;
> u32 b, m, tmp;
>
> 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. Untested patch ahead.

--- linux-2.6.5/drivers/video/riva/fbdev.c.~1~ 2004-04-04 05:37:37.000000000 +0200
+++ linux-2.6.5/drivers/video/riva/fbdev.c 2004-05-14 23:23:38.092744302 +0200
@@ -500,9 +500,9 @@ static void rivafb_load_cursor_image(str

for (i = 0; i < h; i++) {
b = *((u32 *)data);
- b = (u32)((u32 *)b + 1);
+ data = (u8 *)((u32 *)data + 1);
m = *((u32 *)mask);
- m = (u32)((u32 *)m + 1);
+ mask = (u8 *)((u32 *)mask + 1);
reverse_order(&b);

for (j = 0; j < w/2; j++) {

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
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/