WSL2-Linux-Kernel/drivers/power/avs
Nathan Chancellor e093e53f4f power: avs: qcom-cpr: Avoid clang -Wsometimes-uninitialized in cpr_scale
Clang warns (trimmed for brevity):

../drivers/power/avs/qcom-cpr.c:570:13: warning: variable 'reg_mask' is
used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]

../drivers/power/avs/qcom-cpr.c:520:13: warning: variable 'new_uV' is
used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]

Due to the fact that Clang's static analysis happens before any
optimization passes are taken into account, it cannot see that both
branches in the if statement must be taken because dir cannot be
something other than UP or DOWN due to the check at the top of this
function. Change the else if condition to else to fix this false
positive.

Fixes: bf6910abf5 ("power: avs: Add support for CPR (Core Power Reduction)")
Link: https://github.com/ClangBuiltLinux/linux/issues/840
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-01-31 11:07:43 +01:00
..
Kconfig power: avs: qcom-cpr: add unspecified HAS_IOMEM dependency 2020-01-31 11:07:43 +01:00
Makefile power: avs: Add support for CPR (Core Power Reduction) 2019-12-20 10:25:24 +01:00
qcom-cpr.c power: avs: qcom-cpr: Avoid clang -Wsometimes-uninitialized in cpr_scale 2020-01-31 11:07:43 +01:00
rockchip-io-domain.c PM / AVS: rockchip-io: fix the supply naming for the emmc supply on px30 2020-01-31 11:07:43 +01:00
smartreflex.c power: avs: smartreflex: Remove superfluous cast in debugfs_create_file() call 2019-11-13 11:23:51 +01:00