public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] video: fix bug in logo_plot
Date: Sat, 09 Aug 2008 11:13:41 +0200	[thread overview]
Message-ID: <489D5FC5.4020700@denx.de> (raw)
In-Reply-To: <20080809082159.GB18040@game.jcrosoft.org>

Jean-Christophe PLAGNIOL-VILLARD wrote:

<snip>
>> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
>> index 68b9861..97a37ba 100644
>> --- a/drivers/video/cfb_console.c
>> +++ b/drivers/video/cfb_console.c
>> @@ -1071,7 +1071,9 @@ void logo_plot (void *screen, int width, int x, int y)
>>  	int ycount = VIDEO_LOGO_HEIGHT;
>>  	unsigned char r, g, b, *logo_red, *logo_blue, *logo_green;
>>  	unsigned char *source;
>> -	unsigned char *dest = (unsigned char *)screen + ((y * width * VIDEO_PIXEL_SIZE) + x);
>> +	unsigned char *dest = (unsigned char *)screen +
>> +			      ((y * width * VIDEO_PIXEL_SIZE) +
>> +			       x * VIDEO_PIXEL_SIZE);
> why not simplify it?
>> +	unsigned char *dest = (unsigned char *)screen +
>> +			      ((y * width + x) * VIDEO_PIXEL_SIZE);

we could also drop the cast then. How about

+	unsigned char *dest = screen + (y * width + x) * VIDEO_PIXEL_SIZE;
?

  reply	other threads:[~2008-08-09  9:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 16:00 [U-Boot] [PATCH 1/2] video: fix bug in logo_plot Anatolij Gustschin
2008-08-08 16:00 ` [U-Boot] [PATCH 2/2] video: fix bug in cfb_console code Anatolij Gustschin
2008-08-10 22:25   ` Wolfgang Denk
2008-08-09  8:21 ` [U-Boot] [PATCH 1/2] video: fix bug in logo_plot Jean-Christophe PLAGNIOL-VILLARD
2008-08-09  9:13   ` Anatolij Gustschin [this message]
2008-08-10 22:24 ` Wolfgang Denk

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=489D5FC5.4020700@denx.de \
    --to=agust@denx.de \
    --cc=u-boot@lists.denx.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