aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/platinumfb.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-09-22 19:47:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:50 -0400
commit6e3658f0df6f708202159302b4f3915d9b97b8dc (patch)
tree9763b0882b384cf755910cfc8b364422c67baf6c /drivers/video/platinumfb.c
parentd480ace08d5b59133575e672a0bd1c97b0f8400f (diff)
platinumfb: fix misplaced parenthesis
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>
Diffstat (limited to 'drivers/video/platinumfb.c')
-rw-r--r--drivers/video/platinumfb.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index bacfabd9ce1..0a366d86f08 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -223,10 +223,14 @@ static int platinumfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
223 223
224static inline int platinum_vram_reqd(int video_mode, int color_mode) 224static inline int platinum_vram_reqd(int video_mode, int color_mode)
225{ 225{
226 return vmode_attrs[video_mode-1].vres * 226 int baseval = vmode_attrs[video_mode-1].hres * (1<<color_mode);
227 (vmode_attrs[video_mode-1].hres * (1<<color_mode) + 227
228 ((video_mode == VMODE_832_624_75) && 228 if ((video_mode == VMODE_832_624_75) && (color_mode > CMODE_8))
229 (color_mode > CMODE_8)) ? 0x10 : 0x20) + 0x1000; 229 baseval += 0x10;
230 else
231 baseval += 0x20;
232
233 return vmode_attrs[video_mode-1].vres * baseval + 0x1000;
230} 234}
231 235
232#define STORE_D2(a, d) { \ 236#define STORE_D2(a, d) { \