openwrtv4/target/linux/ipq806x
Jonas Gorski 82fb27917b ipq806x: fix uninitialized variable usage in cpufreq-krait
In krait_cpufreq_probe, both freq and max_cpu_freq are never
initialized, so the max_cpu_freq will have a random value at the end.
Fix this by properly initializing max_cpu_freq to 0 and storing the clk
frequency in freq as well, to make it similar to how it's calculated in
krait_set_target.

Fixes the following warnings:

In file included from include/linux/clk.h:16:0,
                 from drivers/cpufreq/cpufreq-krait.c:13:
drivers/cpufreq/cpufreq-krait.c: In function 'krait_cpufreq_probe':
include/linux/kernel.h:714:24: warning: 'freq' may be used uninitialized in this function [-Wmaybe-uninitialized]
  _max1 > _max2 ? _max1 : _max2; })
                        ^
drivers/cpufreq/cpufreq-krait.c:217:25: note: 'freq' was declared here
  unsigned long freq_Hz, freq, max_cpu_freq;
                         ^
In file included from include/linux/clk.h:16:0,
                 from drivers/cpufreq/cpufreq-krait.c:13:
include/linux/kernel.h:714:24: warning: 'max_cpu_freq' may be used uninitialized in this function [-Wmaybe-uninitialized]
  _max1 > _max2 ? _max1 : _max2; })
                        ^
drivers/cpufreq/cpufreq-krait.c:217:31: note: 'max_cpu_freq' was declared here
  unsigned long freq_Hz, freq, max_cpu_freq;

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 46839
2015-09-10 10:09:42 +00:00
..
base-files ipq806x: add support for Netgear Nighthawk X4 R7500 2015-09-04 14:46:06 +00:00
image ipq806x: fix R7500 kernel generation 2015-09-10 10:09:26 +00:00
patches-3.18 ipq806x: fix uninitialized variable usage in cpufreq-krait 2015-09-10 10:09:42 +00:00
patches-4.1 ipq806x: fix uninitialized variable usage in cpufreq-krait 2015-09-10 10:09:42 +00:00
profiles ipq806x: add support for Netgear Nighthawk X4 R7500 2015-09-04 14:46:06 +00:00
base-files.mk ipq806x: Add support for IPQ806x chip family 2014-08-30 09:32:58 +00:00
config-3.18 ipq806x: enable ide led trigger 2015-09-04 14:45:49 +00:00
config-4.1 ipq806x: enable ide led trigger 2015-09-04 14:45:49 +00:00
Makefile ipq806x: enable NAND flash support in the kernel 2015-08-07 08:36:36 +00:00
modules.mk ipq806x: modules: fix typo in usb-dwc3-qcom dependencies 2015-09-10 10:09:36 +00:00