platinumfb: fix misplaced parenthesis
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 22 Sep 2009 23:47:04 +0000 (16:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Sep 2009 14:39:50 +0000 (07:39 -0700)
Since `+' has a higher precedence than the trinary operator `?', this
added `hres * (1 << color_mode)' to the boolean testing videomode and
depth.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/platinumfb.c

index bacfabd..0a366d8 100644 (file)
@@ -223,10 +223,14 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 
 static inline int platinum_vram_reqd(int video_mode, int color_mode)
 {
-       return vmode_attrs[video_mode-1].vres *
-              (vmode_attrs[video_mode-1].hres * (1<<color_mode) +
-               ((video_mode == VMODE_832_624_75) &&
-                (color_mode > CMODE_8)) ? 0x10 : 0x20) + 0x1000;
+       int baseval = vmode_attrs[video_mode-1].hres * (1<<color_mode);
+
+       if ((video_mode == VMODE_832_624_75) && (color_mode > CMODE_8))
+               baseval += 0x10;
+       else
+               baseval += 0x20;
+
+       return vmode_attrs[video_mode-1].vres * baseval + 0x1000;
 }
 
 #define STORE_D2(a, d) { \