diff mbox

[U-Boot,V2,08/12] lcd: get rid of COLOR_MASK

Message ID 1417350585-22669-9-git-send-email-nikita@compulab.co.il
State Superseded
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Nikita Kiryanov Nov. 30, 2014, 12:29 p.m. UTC
COLOR_MASK macro doesn't do anything; Remove it to reduce visual
complexity.

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Simon Glass <sjg@chromium.org>
---
Changes in V2:
	- New patch.

 common/lcd.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Simon Glass Nov. 30, 2014, 7:26 p.m. UTC | #1
On 30 November 2014 at 05:29, Nikita Kiryanov <nikita@compulab.co.il> wrote:
> COLOR_MASK macro doesn't do anything; Remove it to reduce visual
> complexity.
>
> This is a preparatory step for extracting lcd console code into its own
> file.
>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Cc: Anatolij Gustschin <agust@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> ---
> Changes in V2:
>         - New patch.

Acked-by: Simon Glass <sjg@chromium.org>

Tested on pit, LCD works fine.

Tested-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/common/lcd.c b/common/lcd.c
index bc15c78..f98aaaf 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -89,10 +89,8 @@ 
 #define CONSOLE_SIZE		(CONSOLE_ROW_SIZE * console_rows)
 #define CONSOLE_SCROLL_SIZE	(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 
-#if (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
-	(LCD_BPP == LCD_COLOR32)
-# define COLOR_MASK(c)		(c)
-#else
+#if (LCD_BPP != LCD_COLOR8) && (LCD_BPP != LCD_COLOR16) && \
+	(LCD_BPP != LCD_COLOR32)
 # error Unsupported LCD BPP.
 #endif
 
@@ -188,7 +186,7 @@  static void console_scrollup(void)
 	/* Clear the last rows */
 #if (LCD_BPP != LCD_COLOR32)
 	memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
-		COLOR_MASK(lcd_color_bg),
+		lcd_color_bg,
 		CONSOLE_ROW_SIZE * rows);
 #else
 	u32 *ppix = lcd_console_address +
@@ -197,7 +195,7 @@  static void console_scrollup(void)
 	for (i = 0;
 	    i < (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
 	    i++) {
-		*ppix++ = COLOR_MASK(lcd_color_bg);
+		*ppix++ = lcd_color_bg;
 	}
 #endif
 	lcd_sync();
@@ -462,7 +460,7 @@  void lcd_clear(void)
 	/* set framebuffer to background color */
 #if (LCD_BPP != LCD_COLOR32)
 	memset((char *)lcd_base,
-		COLOR_MASK(lcd_color_bg),
+		lcd_color_bg,
 		lcd_line_length * panel_info.vl_row);
 #else
 	u32 *ppix = lcd_base;
@@ -470,7 +468,7 @@  void lcd_clear(void)
 	for (i = 0;
 	   i < (lcd_line_length * panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
 	   i++) {
-		*ppix++ = COLOR_MASK(lcd_color_bg);
+		*ppix++ = lcd_color_bg;
 	}
 #endif
 #endif