linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-fbdev-devel@lists.sourceforge.net, adaplas@gmail.com,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Ville Syrjälä" <syrjala@sci.fi>,
	"Paul Mackerras" <paulus@samba.org>,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: [PATCH] platinumfb: misplaced parenthesis
Date: Mon, 18 May 2009 12:23:57 +0200	[thread overview]
Message-ID: <4A11373D.7030100@gmail.com> (raw)
In-Reply-To: <10f740e80905171011r7955a23bq24081e993b8f50cb@mail.gmail.com>

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>
---
{Thanks,Bedankt} Geert.

diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 03b3670..97f3bf4 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -221,10 +221,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) { \


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects

      reply	other threads:[~2009-05-18 10:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 12:19 [PATCH] staging: misplaced parentheses? Roel Kluin
2009-05-14 16:38 ` Andrew Morton
2009-05-14 23:24   ` Benjamin Herrenschmidt
2009-05-15 10:51     ` Roel Kluin
2009-05-15 20:43     ` [PATCH] platinumfb: misplaced parenthesis Roel Kluin
2009-05-15 21:24       ` Ville Syrjälä
2009-05-15 22:21         ` Benjamin Herrenschmidt
2009-05-17 11:53           ` Roel Kluin
2009-05-17 17:11             ` Geert Uytterhoeven
2009-05-18 10:23               ` Roel Kluin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A11373D.7030100@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=adaplas@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=paulus@samba.org \
    --cc=syrjala@sci.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).