On Thu, 2013-08-08 at 15:36 +0530, Viresh Kumar wrote:
On 8 August 2013 15:31, Jon Medhurst (Tixy) tixy@linaro.org wrote:
This causes the warnings below.
drivers/cpufreq/arm_big_little.c: In function 'bL_cpufreq_set_target': drivers/cpufreq/arm_big_little.c:131:36: warning: 'prev_rate' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/cpufreq/arm_big_little.c:107:16: note: 'prev_rate' was declared here
Looks like an obvious warning but I haven't seen it when I compiled this code :(
Probably something wrong at my end..
Can you initialize with zero in my patch? I don't want to send a patch just for this change. Being too lazy :)
How about we add
bool bLs = is_bL_switching_enabled();
and use "if (bLs)" rather than "if (is_bL_switching_enabled())"?
Probably current name is self descriptive and the new name will impact on readability..
I was proposing that as a fix for the "may be used uninitialized" warning. :-) If we use a local variable then the compiler knows both if clauses are always executed or not as a pair and so knows the variable isn't used uninitialised. Seems the safest fix to me as it lets the compiler warn us about any dodgy use of that variable that may creep in in the future.