[PATCH -mm] riva CalcStateExt gcc 4.1 warning fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux