Re: [PATCH] staging: misplaced parentheses?
From: Andrew Morton <akpm@linux-foundation.org>
Date: 2009-05-14 16:39:09
Subject: [PATCH] staging: misplaced parentheses?
The title is wrong. On Thu, 14 May 2009 14:19:26 +0200 Roel Kluin [off-list ref] wrote:
The leftmost `+' has a higher precedence than the `?' so this returns (vres * hres * (1 << color_mode) + (VMODE && CMODE) ? 0x10 : 0x20) + 0x1000
That seems OK.
quoted hunk ↗ jump to hunk
Signed-off-by: Roel Kluin <redacted> --- The original code looks odd, but I am not entirely certain whether my patch is correct. So please review.diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c index 03b3670..a88f4b6 100644 --- a/drivers/video/platinumfb.c +++ b/drivers/video/platinumfb.c@@ -224,7 +224,7 @@ 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; + (color_mode > CMODE_8) ? 0x10 : 0x20)) + 0x1000; } #define STORE_D2(a, d) { \
The patch changes it to (vres * hres * (1 << color_mode) + (VMODE && (CMODE ? 0x10 : 0x20)) + 0x1000 I think? It makes no sense to do (foo && non-zero-value). ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com