riva CalcStateExt gcc 4.1 warning fix
PATCH 1/1 riva CalcStateExt gcc 4.1 warning fix
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
drivers/video/riva/riva_hw.c +6 -1
@@ -1238,7 +1238,12 @@ static void CalcStateExtint dotClock ) { -int pixelDepth, VClk, m, n, p; +int pixelDepth; +int VClk =0 ; +int m =0 ; +int n =0 ; +int p =0 ; +/* * Save mode parameters. */
Quoted 10 lines · Daniel Walker
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 functiondrivers/video/riva/riva_hw.c:1241: warning: 'n' may be used uninitialized in this functiondrivers/video/riva/riva_hw.c:1241: warning: 'm' may be used uninitialized in this functiondrivers/video/riva/riva_hw.c:1241: warning: 'VClk' may be used uninitialized in this function
But zero isn't valid data. You need to fix the missing return check not hide the warnings. This goes for just about every patch in this series