[PATCH] Warning cleanup for fbcon.c

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Tue Jul 11 2000 - 02:14:49 EST


This simply moves variables to where they are used.

Of course, this file is a complete mess, and should be turned into a
series of inline functions.

Rusty.

diff -urN -X /tmp/fileZ910DB --minimal linux-2.4.0-test3-7/drivers/video/fbcon.c working-2.4.0-test3-7/drivers/video/fbcon.c
--- linux-2.4.0-test3-7/drivers/video/fbcon.c Thu Jun 29 01:26:01 2000
+++ working-2.4.0-test3-7/drivers/video/fbcon.c Mon Jul 10 16:53:38 2000
@@ -2039,11 +2039,9 @@
 {
     struct display *p = &fb_display[fg_console]; /* draw to vt in foreground */
     int depth = p->var.bits_per_pixel;
- int line = p->next_line;
     unsigned char *fb = p->screen_base;
     unsigned char *logo;
- unsigned char *dst, *src;
- int i, j, n, x1, y1, x;
+ int i, j, n, x;
     int logo_depth, done = 0;
 
     /* Return if the frame buffer is not mapped */
@@ -2114,7 +2112,10 @@
             unsigned int val; /* max. depth 32! */
             int bdepth;
             int redshift, greenshift, blueshift;
-
+ unsigned char *dst, *src;
+ int line = p->next_line;
+ int x1, y1;
+
             /* Bug: Doesn't obey msb_right ... (who needs that?) */
             redshift = p->var.red.offset;
             greenshift = p->var.green.offset;
@@ -2188,7 +2189,10 @@
             unsigned char mask[9] = { 0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff };
             unsigned char redmask, greenmask, bluemask;
             int redshift, greenshift, blueshift;
-
+ unsigned char *dst, *src;
+ int line = p->next_line;
+ int x1, y1;
+
             /* Bug: Doesn't obey msb_right ... (who needs that?) */
             redmask = mask[p->var.red.length < 8 ? p->var.red.length : 8];
             greenmask = mask[p->var.green.length < 8 ? p->var.green.length : 8];
@@ -2223,6 +2227,10 @@
 #endif
 #if defined(CONFIG_FBCON_CFB4)
         if (depth == 4 && p->type == FB_TYPE_PACKED_PIXELS) {
+ unsigned char *dst, *src;
+ int line = p->next_line;
+ int x1, y1;
+
                 src = logo;
                 for( y1 = 0; y1 < LOGO_H; y1++) {
                         dst = fb + y1*line + x/2;
@@ -2238,6 +2246,9 @@
 #if defined(CONFIG_FBCON_CFB8) || defined(CONFIG_FB_SBUS)
         if (depth == 8 && p->type == FB_TYPE_PACKED_PIXELS) {
             /* depth 8 or more, packed, with color registers */
+ unsigned char *dst, *src;
+ int line = p->next_line;
+ int x1, y1;
                 
             src = logo;
             for( y1 = 0; y1 < LOGO_H; y1++ ) {
@@ -2257,10 +2268,13 @@
             int bit;
             unsigned char val, mask;
             int plane = p->next_plane;
+ unsigned char *dst, *src;
+ int line = p->next_line;
 
 #if defined(CONFIG_FBCON_IPLAN2P2) || defined(CONFIG_FBCON_IPLAN2P4) || \
     defined(CONFIG_FBCON_IPLAN2P8)
             int line_length = p->line_length;
+ int x1, y1;
 
             /* for support of Atari interleaved planes */
 #define MAP_X(x) (line_length ? (x) : ((x) & ~1)*depth + ((x) & 1))
@@ -2312,6 +2326,9 @@
                            p->type == FB_TYPE_INTERLEAVED_PLANES)) {
 
             /* monochrome */
+ unsigned char *dst, *src;
+ int line = p->next_line;
+ int x1, y1;
             unsigned char inverse = p->inverse || p->visual == FB_VISUAL_MONO01
                 ? 0x00 : 0xff;
 
@@ -2331,6 +2348,10 @@
 #endif
 #if defined(CONFIG_FBCON_VGA_PLANES)
         if (depth == 4 && p->type == FB_TYPE_VGA_PLANES) {
+ unsigned char *dst, *src;
+ int line = p->next_line;
+ int x1, y1;
+
                 outb_p(1,0x3ce); outb_p(0xf,0x3cf);
                 outb_p(3,0x3ce); outb_p(0,0x3cf);
                 outb_p(5,0x3ce); outb_p(0,0x3cf);

--
Hacking time.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:12 EST