mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: "J. Ryan Earl" <heretic@clanhk.org>
Cc: discuss@x86-64.org, linux-kernel@vger.kernel.org
Subject: Re: drivers/video/riva/fbdev.c broken on x86_64
Date: Fri, 14 May 2004 23:28:02 +0200	[thread overview]
Message-ID: <je4qqi1yxp.fsf@sykes.suse.de> (raw)
In-Reply-To: <40A514BD.1050308@clanhk.org> (J. Ryan Earl's message of "Fri, 14 May 2004 13:49:33 -0500")

"J. Ryan Earl" <heretic@clanhk.org> 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@suse.de
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."

  reply	other threads:[~2004-05-14 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-14 18:49 J. Ryan Earl
2004-05-14 21:28 ` Andreas Schwab [this message]
2004-05-14 23:36   ` Andrew Morton
2004-05-15  0:23     ` J. Ryan Earl

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=je4qqi1yxp.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=discuss@x86-64.org \
    --cc=heretic@clanhk.org \
    --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

all inboxes | Powered by JetHome®