From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Sat, 09 Aug 2008 11:13:41 +0200 Subject: [U-Boot] [PATCH 1/2] video: fix bug in logo_plot In-Reply-To: <20080809082159.GB18040@game.jcrosoft.org> References: <1218211240-21667-1-git-send-email-agust@denx.de> <20080809082159.GB18040@game.jcrosoft.org> Message-ID: <489D5FC5.4020700@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Jean-Christophe PLAGNIOL-VILLARD wrote: >> 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; ?