Commit e4995b12 authored by Finn Thain's avatar Finn Thain Committed by Bartlomiej Zolnierkiewicz

video/macfb: Remove redundant code

The value of info->var.bits_per_pixel get checked in macfb_setcolreg().
Remove additional checks as they are redundant.

macfb_defined.activate gets initialized to FB_ACTIVATE_NOW by the struct
initializer. Remove redundant assignments.

macfb_defined.bits_per_pixel, .width and .height all get assigned
unconditionally. Remove redundant initializers.
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 3f984342
...@@ -120,10 +120,7 @@ struct jet_cmap_regs { ...@@ -120,10 +120,7 @@ struct jet_cmap_regs {
#define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */ #define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */
static struct fb_var_screeninfo macfb_defined = { static struct fb_var_screeninfo macfb_defined = {
.bits_per_pixel = 8,
.activate = FB_ACTIVATE_NOW, .activate = FB_ACTIVATE_NOW,
.width = -1,
.height = -1,
.right_margin = 32, .right_margin = 32,
.upper_margin = 16, .upper_margin = 16,
.lower_margin = 4, .lower_margin = 4,
...@@ -201,9 +198,6 @@ static int v8_brazil_setpalette(unsigned int regno, unsigned int red, ...@@ -201,9 +198,6 @@ static int v8_brazil_setpalette(unsigned int regno, unsigned int red,
unsigned int bpp = info->var.bits_per_pixel; unsigned int bpp = info->var.bits_per_pixel;
unsigned long flags; unsigned long flags;
if (bpp > 8)
return 1; /* failsafe */
local_irq_save(flags); local_irq_save(flags);
/* On these chips, the CLUT register numbers are spread out /* On these chips, the CLUT register numbers are spread out
...@@ -234,9 +228,6 @@ static int rbv_setpalette(unsigned int regno, unsigned int red, ...@@ -234,9 +228,6 @@ static int rbv_setpalette(unsigned int regno, unsigned int red,
{ {
unsigned long flags; unsigned long flags;
if (info->var.bits_per_pixel > 8)
return 1; /* failsafe */
local_irq_save(flags); local_irq_save(flags);
/* From the VideoToolbox driver. Seems to be saying that /* From the VideoToolbox driver. Seems to be saying that
...@@ -353,9 +344,6 @@ static int civic_setpalette(unsigned int regno, unsigned int red, ...@@ -353,9 +344,6 @@ static int civic_setpalette(unsigned int regno, unsigned int red,
unsigned long flags; unsigned long flags;
int clut_status; int clut_status;
if (info->var.bits_per_pixel > 8)
return 1; /* failsafe */
local_irq_save(flags); local_irq_save(flags);
/* Set the register address */ /* Set the register address */
...@@ -688,17 +676,14 @@ static int __init macfb_init(void) ...@@ -688,17 +676,14 @@ static int __init macfb_init(void)
case NUBUS_DRHW_APPLE_MDC: case NUBUS_DRHW_APPLE_MDC:
strcpy(macfb_fix.id, "Mac Disp. Card"); strcpy(macfb_fix.id, "Mac Disp. Card");
macfb_setpalette = mdc_setpalette; macfb_setpalette = mdc_setpalette;
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
case NUBUS_DRHW_APPLE_TFB: case NUBUS_DRHW_APPLE_TFB:
strcpy(macfb_fix.id, "Toby"); strcpy(macfb_fix.id, "Toby");
macfb_setpalette = toby_setpalette; macfb_setpalette = toby_setpalette;
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
case NUBUS_DRHW_APPLE_JET: case NUBUS_DRHW_APPLE_JET:
strcpy(macfb_fix.id, "Jet"); strcpy(macfb_fix.id, "Jet");
macfb_setpalette = jet_setpalette; macfb_setpalette = jet_setpalette;
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
default: default:
strcpy(macfb_fix.id, "Generic NuBus"); strcpy(macfb_fix.id, "Generic NuBus");
...@@ -731,7 +716,6 @@ static int __init macfb_init(void) ...@@ -731,7 +716,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "DAFB"); strcpy(macfb_fix.id, "DAFB");
macfb_setpalette = dafb_setpalette; macfb_setpalette = dafb_setpalette;
dafb_cmap_regs = ioremap(DAFB_BASE, 0x1000); dafb_cmap_regs = ioremap(DAFB_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
/* /*
...@@ -741,7 +725,6 @@ static int __init macfb_init(void) ...@@ -741,7 +725,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "V8"); strcpy(macfb_fix.id, "V8");
macfb_setpalette = v8_brazil_setpalette; macfb_setpalette = v8_brazil_setpalette;
v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000); v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
/* /*
...@@ -755,7 +738,6 @@ static int __init macfb_init(void) ...@@ -755,7 +738,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "Brazil"); strcpy(macfb_fix.id, "Brazil");
macfb_setpalette = v8_brazil_setpalette; macfb_setpalette = v8_brazil_setpalette;
v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000); v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
/* /*
...@@ -772,7 +754,6 @@ static int __init macfb_init(void) ...@@ -772,7 +754,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "Sonora"); strcpy(macfb_fix.id, "Sonora");
macfb_setpalette = v8_brazil_setpalette; macfb_setpalette = v8_brazil_setpalette;
v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000); v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
/* /*
...@@ -785,7 +766,6 @@ static int __init macfb_init(void) ...@@ -785,7 +766,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "RBV"); strcpy(macfb_fix.id, "RBV");
macfb_setpalette = rbv_setpalette; macfb_setpalette = rbv_setpalette;
rbv_cmap_regs = ioremap(DAC_BASE, 0x1000); rbv_cmap_regs = ioremap(DAC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
/* /*
...@@ -796,7 +776,6 @@ static int __init macfb_init(void) ...@@ -796,7 +776,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "Civic"); strcpy(macfb_fix.id, "Civic");
macfb_setpalette = civic_setpalette; macfb_setpalette = civic_setpalette;
civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000); civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
...@@ -810,7 +789,6 @@ static int __init macfb_init(void) ...@@ -810,7 +789,6 @@ static int __init macfb_init(void)
macfb_setpalette = v8_brazil_setpalette; macfb_setpalette = v8_brazil_setpalette;
v8_brazil_cmap_regs = v8_brazil_cmap_regs =
ioremap(DAC_BASE, 0x1000); ioremap(DAC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
} }
break; break;
...@@ -823,7 +801,6 @@ static int __init macfb_init(void) ...@@ -823,7 +801,6 @@ static int __init macfb_init(void)
macfb_setpalette = v8_brazil_setpalette; macfb_setpalette = v8_brazil_setpalette;
v8_brazil_cmap_regs = v8_brazil_cmap_regs =
ioremap(DAC_BASE, 0x1000); ioremap(DAC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
} }
break; break;
...@@ -892,7 +869,6 @@ static int __init macfb_init(void) ...@@ -892,7 +869,6 @@ static int __init macfb_init(void)
strcpy(macfb_fix.id, "CSC"); strcpy(macfb_fix.id, "CSC");
macfb_setpalette = csc_setpalette; macfb_setpalette = csc_setpalette;
csc_cmap_regs = ioremap(CSC_BASE, 0x1000); csc_cmap_regs = ioremap(CSC_BASE, 0x1000);
macfb_defined.activate = FB_ACTIVATE_NOW;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment