public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Ryan Earl" <heretic@clanhk.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Andreas Schwab <schwab@suse.de>,
	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 19:23:43 -0500	[thread overview]
Message-ID: <40A5630F.4040806@clanhk.org> (raw)
In-Reply-To: <20040514163620.13b9172b.akpm@osdl.org>

Andreas' patch fixed part of the cursor problem, at least on the shell 
it's horizontal and not vertical.  However, it's still glitchy, in 
particular in a 'make menuconfig' the cursor blinks with random garbage 
in it.  I think it has to do with this warning:

  CC      drivers/video/fbmem.o
drivers/video/fbmem.c: In function `fb_cursor':
drivers/video/fbmem.c:917: warning: passing arg 1 of `copy_from_user' 
discards qualifiers from pointer target type

This line:
                if (copy_from_user(cursor.image.data, 
sprite->image.data, size) ||

-ryan

Andrew Morton wrote:

>Andreas Schwab <schwab@suse.de> 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++) {
>
>_
>
>  
>


      reply	other threads:[~2004-05-15  0:27 UTC|newest]

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

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=40A5630F.4040806@clanhk.org \
    --to=heretic@clanhk.org \
    --cc=akpm@osdl.org \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwab@suse.de \
    /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