diff options
author | Arnd Bergmann <[email protected]> | 2016-01-25 16:45:48 +0100 |
---|---|---|
committer | Rafael J. Wysocki <[email protected]> | 2016-01-27 23:23:54 +0100 |
commit | b331bc20d9281213f7fb67912638e0fb5baeb324 (patch) | |
tree | e55d1bfa61250b0b11b55f586dc70e5240ccaedb /lib/netdev-notifier-error-inject.c | |
parent | fb2a24a1c6457d21df9fae0dd66b20c63ba56077 (diff) |
cpufreq: cpufreq-dt: avoid uninitialized variable warnings:
gcc warns quite a bit about values returned from allocate_resources()
in cpufreq-dt.c:
cpufreq-dt.c: In function 'cpufreq_init':
cpufreq-dt.c:327:6: error: 'cpu_dev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cpufreq-dt.c:197:17: note: 'cpu_dev' was declared here
cpufreq-dt.c:376:2: error: 'cpu_clk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cpufreq-dt.c:199:14: note: 'cpu_clk' was declared here
cpufreq-dt.c: In function 'dt_cpufreq_probe':
cpufreq-dt.c:461:2: error: 'cpu_clk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cpufreq-dt.c:447:14: note: 'cpu_clk' was declared here
The problem is that it's slightly hard for gcc to follow return
codes across PTR_ERR() calls.
This patch uses explicit assignments to the "ret" variable to make
it easier for gcc to verify that the code is actually correct,
without the need to add a bogus initialization.
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'lib/netdev-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions