summaryrefslogtreecommitdiff
path: root/common/lcd.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2011-08-09 09:43:40 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:27 -0700
commitdae320288dcda9cae8a98b885e16ba8251294840 (patch)
treee7c7b27e2f95517c536ea210704358738d5a676a /common/lcd.c
parent0c8b6583a0a9c23c9041c790a78ec6aaeb7d69dc (diff)
Fix compiler warnings generated by gcc 4.6.
The newer compiler version is more thorough in detecting code inconsistencies, and reports warnings in many cases when building u-boot for kaen and alex. This change modifies the code to get rid of the warnings. There supposed to be no logical changes, so no testing other than building the system is being done. The files not yet upstreamed are excluded and will be submitted separately. BUG=chromium-os:18862 TEST=manual . run the following commands emerge-tegra2_kaen chromeos-u-boot emerge-x86-alex chromeos-u-boot . observe them succeed Change-Id: I4c872d84352539d24a418ba910274d08d02d26a8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/5706 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/lcd.c')
-rw-r--r--common/lcd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/lcd.c b/common/lcd.c
index ce93ba3c99..f95cab4923 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -243,10 +243,13 @@ void lcd_printf(const char *fmt, ...)
static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
{
uchar *dest;
- ushort off, row;
+ ushort row;
- dest = (uchar *)(lcd_base + y * lcd_line_length + x * (1 << LCD_BPP) / 8);
+#if LCD_BPP == LCD_MONOCHROME
+ ushort off;
off = x * (1 << LCD_BPP) % 8;
+#endif
+ dest = (uchar *)(lcd_base + y * lcd_line_length + x * (1 << LCD_BPP) / 8);
for (row=0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
uchar *s = str;