From patchwork Sat Jan 5 19:45:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 209692 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7AB3B2C0085 for ; Sun, 6 Jan 2013 06:46:04 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E55C4A09E; Sat, 5 Jan 2013 20:46:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wuz8OmZNYU-A; Sat, 5 Jan 2013 20:46:02 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5AE134A09F; Sat, 5 Jan 2013 20:46:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5F11B4A09F for ; Sat, 5 Jan 2013 20:45:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wsWy+qij66bK for ; Sat, 5 Jan 2013 20:45:58 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id 7F3F64A09E for ; Sat, 5 Jan 2013 20:45:57 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3Ydtdb0NwXz4KK2H; Sat, 5 Jan 2013 20:45:54 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3YdtdZ1BLFzbbgS; Sat, 5 Jan 2013 20:45:54 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from smtp-auth.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id DZu39BKlbjRq; Sat, 5 Jan 2013 20:45:32 +0100 (CET) X-Auth-Info: LnA9rlVw5OUpJr6LOt7e3tOSCv89Tz5MDWN1/vPBpmA= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Sat, 5 Jan 2013 20:45:52 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id A066C1A1472; Sat, 5 Jan 2013 20:45:52 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 78D62200780; Sat, 5 Jan 2013 20:45:52 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Sat, 5 Jan 2013 20:45:48 +0100 Message-Id: <1357415148-9243-1-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <50E86DFC.20304@myspectrum.nl> References: <50E86DFC.20304@myspectrum.nl> Cc: Stelian Pop , Kyungmin Park , Haavard Skinnemoen , Tom Warren , Bo Shen , Alessandro Rubini Subject: [U-Boot] [PATCH] common/lcd.c: cleanup use of global variables X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de lcd_color_fg and lcd_color_bg had to be declared in board specific code, but were not actually used there; in addition, we have getter / setter functions for these, which were not used either. Get rid of the global variables, and use the getter function where needed (so far no setter calls are needed). Signed-off-by: Wolfgang Denk Cc: Alessandro Rubini Cc: Anatolij Gustschin Cc: Bo Shen Cc: Haavard Skinnemoen Cc: Kyungmin Park Cc: Marek Vasut Cc: Minkyu Kang Cc: Nikita Kiryanov Cc: Simon Glass Cc: Stelian Pop Cc: Tom Warren Acked-by: Simon Glass Acked-by: Jeroen Hofstee --- arch/arm/cpu/pxa/pxafb.c | 2 -- arch/powerpc/cpu/mpc8xx/lcd.c | 3 --- board/mcc200/lcd.c | 3 --- common/lcd.c | 7 ++++--- drivers/video/amba.c | 2 -- drivers/video/atmel_hlcdfb.c | 2 -- drivers/video/atmel_lcdfb.c | 2 -- drivers/video/exynos_fb.c | 2 -- drivers/video/tegra.c | 4 +--- include/lcd.h | 6 +++--- 10 files changed, 8 insertions(+), 25 deletions(-) diff --git a/arch/arm/cpu/pxa/pxafb.c b/arch/arm/cpu/pxa/pxafb.c index 987fa06..25747b1 100644 --- a/arch/arm/cpu/pxa/pxafb.c +++ b/arch/arm/cpu/pxa/pxafb.c @@ -333,8 +333,6 @@ void lcd_ctrl_init (void *lcdbase); void lcd_enable (void); int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; void *lcd_base; /* Start of framebuffer memory */ void *lcd_console_address; /* Start of console buffer */ diff --git a/arch/powerpc/cpu/mpc8xx/lcd.c b/arch/powerpc/cpu/mpc8xx/lcd.c index 4b88b21..4fd44ac 100644 --- a/arch/powerpc/cpu/mpc8xx/lcd.c +++ b/arch/powerpc/cpu/mpc8xx/lcd.c @@ -258,9 +258,6 @@ vidinfo_t panel_info = { int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; - /* * Frame buffer memory information */ diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c index 893f4b7..0f3f585 100644 --- a/board/mcc200/lcd.c +++ b/board/mcc200/lcd.c @@ -70,9 +70,6 @@ vidinfo_t panel_info = { int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; - /* * Frame buffer memory information */ diff --git a/common/lcd.c b/common/lcd.c index 4778655..b67724e 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -97,6 +97,9 @@ static int lcd_getbgcolor(void); static void lcd_setfgcolor(int color); static void lcd_setbgcolor(int color); +static int lcd_color_fg; +static int lcd_color_bg; + char lcd_is_enabled = 0; static char lcd_flush_dcache; /* 1 to flush dcache after each lcd update */ @@ -532,12 +535,10 @@ static void lcd_setbgcolor(int color) /*----------------------------------------------------------------------*/ -#ifdef NOT_USED_SO_FAR -static int lcd_getfgcolor(void) +int lcd_getfgcolor(void) { return lcd_color_fg; } -#endif /* NOT_USED_SO_FAR */ /*----------------------------------------------------------------------*/ diff --git a/drivers/video/amba.c b/drivers/video/amba.c index ffa1c39..b4fb47d 100644 --- a/drivers/video/amba.c +++ b/drivers/video/amba.c @@ -29,8 +29,6 @@ /* These variables are required by lcd.c -- although it sets them by itself */ int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; void *lcd_base; void *lcd_console_address; short console_col; diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c index b10ca4b..e74eb65 100644 --- a/drivers/video/atmel_hlcdfb.c +++ b/drivers/video/atmel_hlcdfb.c @@ -30,8 +30,6 @@ #include int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; void *lcd_base; /* Start of framebuffer memory */ void *lcd_console_address; /* Start of console buffer */ diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index c02ffd8..d96f175 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -30,8 +30,6 @@ #include int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; void *lcd_base; /* Start of framebuffer memory */ void *lcd_console_address; /* Start of console buffer */ diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c index d9a3f9a..3dd6100 100644 --- a/drivers/video/exynos_fb.c +++ b/drivers/video/exynos_fb.c @@ -34,8 +34,6 @@ #include "exynos_fb.h" int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; void *lcd_base; void *lcd_console_address; diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c index 750a283..3709d0b 100644 --- a/drivers/video/tegra.c +++ b/drivers/video/tegra.c @@ -61,8 +61,6 @@ enum { }; int lcd_line_length; -int lcd_color_fg; -int lcd_color_bg; void *lcd_base; /* Start of framebuffer memory */ void *lcd_console_address; /* Start of console buffer */ @@ -108,7 +106,7 @@ void lcd_toggle_cursor(void) for (i = 0; i < lcd_cursor_width; ++i) { color = *d; - color ^= lcd_color_fg; + color ^= lcd_getfgcolor(); *d = color; ++d; } diff --git a/include/lcd.h b/include/lcd.h index c24164a..7d8c41f 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -32,13 +32,11 @@ extern char lcd_is_enabled; extern int lcd_line_length; -extern int lcd_color_fg; -extern int lcd_color_bg; /* * Frame buffer memory information */ -extern void *lcd_base; /* Start of framebuffer memory */ +extern void *lcd_base; /* Start of framebuffer memory */ extern void *lcd_console_address; /* Start of console buffer */ extern short console_col; @@ -53,6 +51,8 @@ extern void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue); extern void lcd_initcolregs (void); +extern int lcd_getfgcolor(void); + /* gunzip_bmp used if CONFIG_VIDEO_BMP_GZIP */ extern struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp); extern int bmp_display(ulong addr, int x, int y);