[PATCH -mm] riva CalcStateExt gcc 4.1 warning fix

From: Daniel Walker
Date: Tue May 09 2006 - 23:01:49 EST


This could be a bug. The return from CalcVClock isn't checked
so the variables in questions could be random data ..

Fixes the following warning,

drivers/video/riva/riva_hw.c: In function 'CalcStateExt':
drivers/video/riva/riva_hw.c:1241: warning: 'p' may be used uninitialized in this function
drivers/video/riva/riva_hw.c:1241: warning: 'n' may be used uninitialized in this function
drivers/video/riva/riva_hw.c:1241: warning: 'm' may be used uninitialized in this function
drivers/video/riva/riva_hw.c:1241: warning: 'VClk' may be used uninitialized in this function


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

Index: linux-2.6.16/drivers/video/riva/riva_hw.c
===================================================================
--- linux-2.6.16.orig/drivers/video/riva/riva_hw.c
+++ linux-2.6.16/drivers/video/riva/riva_hw.c
@@ -1238,7 +1238,12 @@ static void CalcStateExt
int dotClock
)
{
- int pixelDepth, VClk, m, n, p;
+ int pixelDepth;
+ int VClk = 0;
+ int m = 0;
+ int n = 0;
+ int p = 0;
+
/*
* Save mode parameters.
*/
-
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/