Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev/g364fb: Fix build failure

This patch resolves these compiler errors and warnings --

CC drivers/video/fbdev/g364fb.o
drivers/video/fbdev/g364fb.c: In function 'g364fb_cursor':
drivers/video/fbdev/g364fb.c:137:9: error: 'x' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:137:9: note: each undeclared identifier is reported only once for each function it appears in
drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontwidth' [-Werror=implicit-function-declaration]
drivers/video/fbdev/g364fb.c:137:23: error: 'p' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:137:38: error: 'y' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:137:7: error: implicit declaration of function 'fontheight' [-Werror=implicit-function-declaration]
drivers/video/fbdev/g364fb.c: In function 'g364fb_init':
drivers/video/fbdev/g364fb.c:233:24: error: 'fbvar' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:234:24: error: 'xres' undeclared (first use in this function)
drivers/video/fbdev/g364fb.c:201:14: warning: unused variable 'j' [-Wunused-variable]
drivers/video/fbdev/g364fb.c:197:25: warning: unused variable 'pal_ptr' [-Wunused-variable]

The MIPS Magnum framebuffer console now works when tested in QEMU.

Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org

authored by

Finn Thain and committed by
Paul Burton
c584f953 f6541f34

+3 -26
+3 -26
drivers/video/fbdev/g364fb.c
··· 108 108 static int g364fb_setcolreg(u_int regno, u_int red, u_int green, 109 109 u_int blue, u_int transp, 110 110 struct fb_info *info); 111 - static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor); 112 111 static int g364fb_blank(int blank, struct fb_info *info); 113 112 114 113 static const struct fb_ops g364fb_ops = { ··· 118 119 .fb_fillrect = cfb_fillrect, 119 120 .fb_copyarea = cfb_copyarea, 120 121 .fb_imageblit = cfb_imageblit, 121 - .fb_cursor = g364fb_cursor, 122 122 }; 123 - 124 - int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor) 125 - { 126 - 127 - switch (cursor->enable) { 128 - case CM_ERASE: 129 - *(unsigned int *) CTLA_REG |= CURS_TOGGLE; 130 - break; 131 - 132 - case CM_MOVE: 133 - case CM_DRAW: 134 - *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE; 135 - *(unsigned int *) CURS_POS_REG = 136 - ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) - 137 - info->var.yoffset); 138 - break; 139 - } 140 - return 0; 141 - } 142 123 143 124 /* 144 125 * Pan or Wrap the Display ··· 173 194 */ 174 195 int __init g364fb_init(void) 175 196 { 176 - volatile unsigned int *pal_ptr = 177 - (volatile unsigned int *) CLR_PAL_REG; 178 197 volatile unsigned int *curs_pal_ptr = 179 198 (volatile unsigned int *) CURS_PAL_REG; 180 - int mem, i, j; 199 + int mem, i; 181 200 182 201 if (fb_get_options("g364fb", NULL)) 183 202 return -ENODEV; ··· 207 230 */ 208 231 *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff; 209 232 *(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff; 210 - fb_var.xres_virtual = fbvar.xres; 211 - fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel; 233 + fb_var.xres_virtual = fb_var.xres; 234 + fb_fix.line_length = fb_var.xres_virtual * fb_var.bits_per_pixel / 8; 212 235 fb_fix.smem_start = 0x40000000; /* physical address */ 213 236 /* get size of video memory; this is special for the JAZZ hardware */ 214 237 mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3;