[PATCH -mm] matroxfb_maven gcc 4.1 warning fix

From: Daniel Walker
Date: Tue May 09 2006 - 23:00:36 EST


It looks possible that the PLL and clock functions might get into a condition
when these stack variables would get used/returned with uninitialized
data . So it needs further review ..

Fixes the following warning,

drivers/video/matrox/matroxfb_maven.c: In function 'maven_out_compute':
drivers/video/matrox/matroxfb_maven.c:287: warning: 'p' may be used uninitialized in this function
drivers/video/matrox/matroxfb_maven.c:718: warning: 'h2' may be used uninitialized in this function
drivers/video/matrox/matroxfb_maven.c:718: warning: 'b' may be used uninitialized in this function
drivers/video/matrox/matroxfb_maven.c:718: warning: 'a' may be used uninitialized in this function

Signed-Off-By: Daniel Walker <dwalker@xxxxxxxxxx>

Index: linux-2.6.16/drivers/video/matrox/matroxfb_maven.c
===================================================================
--- linux-2.6.16.orig/drivers/video/matrox/matroxfb_maven.c
+++ linux-2.6.16/drivers/video/matrox/matroxfb_maven.c
@@ -284,7 +284,7 @@ static unsigned int matroxfb_mavenclock(
unsigned int* in, unsigned int* feed, unsigned int* post,
unsigned int* htotal2) {
unsigned int fvco;
- unsigned int p;
+ unsigned int p = 0;

fvco = matroxfb_PLL_mavenclock(&maven1000_pll, ctl, htotal, vtotal, in, feed, &p, htotal2);
if (!fvco)
@@ -715,7 +715,10 @@ static int maven_find_exact_clocks(unsig
m->regs[0x82] = 0x81;

for (x = 0; x < 8; x++) {
- unsigned int a, b, c, h2;
+ unsigned int a = 0;
+ unsigned int b = 0;
+ unsigned int h2 = 0;
+ unsigned int c;
unsigned int h = ht + 2 + x;

if (!matroxfb_mavenclock((m->mode == MATROXFB_OUTPUT_MODE_PAL) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/