[U-Boot] [PATCH] video: move extern declarations from C to headers

Alessandro Rubini rubini-list at gnudd.com
Sun Jul 19 17:52:27 CEST 2009


From: Alessandro Rubini <rubini at gnudd.com>

This moves some extern declaration from lcd.c to lcd.h, removing
unneeded ifdef around a pair of them.  Additionally, since
gunzip_bmp() was declared static in cmd_bmp.c but extern in lcd.c, I
removed the static.  The extra "#include <lcd.h>" in cmd_bmp.c is
added to ensure the header is consistent with the source.

This has been compile-tested on both ARM (at91 boards) and PowerPC
(HH405_config, TQM823L_LCD_config, mcc200_config), to test all use
combinations.

Signed-off-by: Alessandro Rubini <rubini at gnudd.it>
---
 common/cmd_bmp.c |    5 +++--
 common/lcd.c     |   16 ----------------
 include/lcd.h    |   12 ++++++++++++
 3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index fc8462e..faa10a4 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <lcd.h>
 #include <bmp_layout.h>
 #include <command.h>
 #include <asm/byteorder.h>
@@ -46,7 +47,7 @@ int gunzip(void *, int, unsigned char *, unsigned long *);
  * didn't contain a valid BMP signature.
  */
 #ifdef CONFIG_VIDEO_BMP_GZIP
-static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp)
+bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp)
 {
 	void *dst;
 	unsigned long len;
@@ -85,7 +86,7 @@ static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp)
 	return bmp;
 }
 #else
-static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp)
+bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp)
 {
 	return NULL;
 }
diff --git a/common/lcd.c b/common/lcd.c
index c87de0b..dc8fea6 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -79,25 +79,13 @@ static inline void lcd_putc_xy (ushort x, ushort y, uchar  c);
 static int lcd_init (void *lcdbase);
 
 static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
-extern void lcd_ctrl_init (void *lcdbase);
-extern void lcd_enable (void);
 static void *lcd_logo (void);
 
-
-#if (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16)
-extern void lcd_setcolreg (ushort regno,
-				ushort red, ushort green, ushort blue);
-#endif
-#if LCD_BPP == LCD_MONOCHROME
-extern void lcd_initcolregs (void);
-#endif
-
 static int lcd_getbgcolor (void);
 static void lcd_setfgcolor (int color);
 static void lcd_setbgcolor (int color);
 
 char lcd_is_enabled = 0;
-extern vidinfo_t panel_info;
 
 #ifdef	NOT_USED_SO_FAR
 static void lcd_getcolreg (ushort regno,
@@ -815,10 +803,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 }
 #endif
 
-#ifdef CONFIG_VIDEO_BMP_GZIP
-extern bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp);
-#endif
-
 static void *lcd_logo (void)
 {
 #ifdef CONFIG_SPLASH_SCREEN
diff --git a/include/lcd.h b/include/lcd.h
index f054cac..2de36ab 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -43,6 +43,18 @@ extern void *lcd_console_address;	/* Start of console buffer	*/
 
 extern short console_col;
 extern short console_row;
+extern struct vidinfo panel_info;
+
+extern void lcd_ctrl_init (void *lcdbase);
+extern void lcd_enable (void);
+
+/* setcolreg used in 8bpp/16bpp; initcolregs used in monochrome */
+extern void lcd_setcolreg (ushort regno,
+				ushort red, ushort green, ushort blue);
+extern void lcd_initcolregs (void);
+
+/* gunzip_bmp used if CONFIG_VIDEO_BMP_GZIP */
+extern struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp);
 
 #if defined CONFIG_MPC823
 /*
-- 
1.6.0.2


More information about the U-Boot mailing list