]> git.sur5r.net Git - u-boot/commitdiff
lcd: cleanup lcd_drawchars
authorNikita Kiryanov <nikita@compulab.co.il>
Mon, 8 Dec 2014 15:14:36 +0000 (17:14 +0200)
committerAnatolij Gustschin <agust@denx.de>
Sat, 10 Jan 2015 16:47:59 +0000 (17:47 +0100)
Remove code duplication from lcd_drawchars().

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
common/lcd.c

index 70b848c7e96c6057e589d64aea824746304f4c2f..80923e91185f2056f9a0a45f42363fc17e31666b 100644 (file)
@@ -346,19 +346,7 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
 
                        *d++ = rest | (sym >> off);
                        rest = sym << (8-off);
-#elif LCD_BPP == LCD_COLOR8
-                       for (c = 0; c < 8; ++c) {
-                               *d++ = (bits & 0x80) ?
-                                               lcd_color_fg : lcd_color_bg;
-                               bits <<= 1;
-                       }
-#elif LCD_BPP == LCD_COLOR16
-                       for (c = 0; c < 8; ++c) {
-                               *d++ = (bits & 0x80) ?
-                                               lcd_color_fg : lcd_color_bg;
-                               bits <<= 1;
-                       }
-#elif LCD_BPP == LCD_COLOR32
+#else /* LCD_BPP == LCD_COLOR8 or LCD_COLOR16 or LCD_COLOR32 */
                        for (c = 0; c < 8; ++c) {
                                *d++ = (bits & 0x80) ?
                                                lcd_color_fg : lcd_color_bg;