staging: sm7xxfb: code cleanup on smtcfb_setmode
authorJavier M. Mellid <jmunhoz@igalia.com>
Tue, 26 Jun 2012 04:00:17 +0000 (06:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jun 2012 22:03:54 +0000 (15:03 -0700)
Code cleanup on smtcfb_setmode.

Tested with SM712.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm7xxfb/sm7xxfb.c

index e5d016b9259ad9517057e6c723d1d4c96c208129..16d2b5eda80c1ac5bda7e066be4f2bc2cb321e35 100644 (file)
@@ -557,55 +557,49 @@ void smtcfb_setmode(struct smtcfb_info *sfb)
 {
        switch (sfb->fb.var.bits_per_pixel) {
        case 32:
-               sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
-               sfb->fb.fix.line_length = sfb->fb.var.xres * 4;
-               sfb->fb.var.red.length = 8;
+               sfb->fb.fix.visual       = FB_VISUAL_TRUECOLOR;
+               sfb->fb.fix.line_length  = sfb->fb.var.xres * 4;
+               sfb->fb.var.red.length   = 8;
                sfb->fb.var.green.length = 8;
-               sfb->fb.var.blue.length = 8;
-               sfb->fb.var.red.offset = 16;
+               sfb->fb.var.blue.length  = 8;
+               sfb->fb.var.red.offset   = 16;
                sfb->fb.var.green.offset = 8;
-               sfb->fb.var.blue.offset = 0;
-
-               break;
-       case 8:
-               sfb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
-               sfb->fb.fix.line_length = sfb->fb.var.xres;
-               sfb->fb.var.red.offset = 5;
-               sfb->fb.var.red.length = 3;
-               sfb->fb.var.green.offset = 2;
-               sfb->fb.var.green.length = 3;
-               sfb->fb.var.blue.offset = 0;
-               sfb->fb.var.blue.length = 2;
+               sfb->fb.var.blue.offset  = 0;
                break;
        case 24:
-               sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
-               sfb->fb.fix.line_length = sfb->fb.var.xres * 3;
-               sfb->fb.var.red.length = 8;
+               sfb->fb.fix.visual       = FB_VISUAL_TRUECOLOR;
+               sfb->fb.fix.line_length  = sfb->fb.var.xres * 3;
+               sfb->fb.var.red.length   = 8;
                sfb->fb.var.green.length = 8;
-               sfb->fb.var.blue.length = 8;
-
-               sfb->fb.var.red.offset = 16;
+               sfb->fb.var.blue.length  = 8;
+               sfb->fb.var.red.offset   = 16;
                sfb->fb.var.green.offset = 8;
-               sfb->fb.var.blue.offset = 0;
-
+               sfb->fb.var.blue.offset  = 0;
+               break;
+       case 8:
+               sfb->fb.fix.visual       = FB_VISUAL_PSEUDOCOLOR;
+               sfb->fb.fix.line_length  = sfb->fb.var.xres;
+               sfb->fb.var.red.length   = 3;
+               sfb->fb.var.green.length = 3;
+               sfb->fb.var.blue.length  = 2;
+               sfb->fb.var.red.offset   = 5;
+               sfb->fb.var.green.offset = 2;
+               sfb->fb.var.blue.offset  = 0;
                break;
        case 16:
        default:
-               sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
-               sfb->fb.fix.line_length = sfb->fb.var.xres * 2;
-
-               sfb->fb.var.red.length = 5;
+               sfb->fb.fix.visual       = FB_VISUAL_TRUECOLOR;
+               sfb->fb.fix.line_length  = sfb->fb.var.xres * 2;
+               sfb->fb.var.red.length   = 5;
                sfb->fb.var.green.length = 6;
-               sfb->fb.var.blue.length = 5;
-
-               sfb->fb.var.red.offset = 11;
+               sfb->fb.var.blue.length  = 5;
+               sfb->fb.var.red.offset   = 11;
                sfb->fb.var.green.offset = 5;
-               sfb->fb.var.blue.offset = 0;
-
+               sfb->fb.var.blue.offset  = 0;
                break;
        }
 
-       sfb->width = sfb->fb.var.xres;
+       sfb->width  = sfb->fb.var.xres;
        sfb->height = sfb->fb.var.yres;
        sfb->hz = 60;
        smtc_set_timing(sfb);