linux/drivers/clk/spear
Kees Cook fec61ff40b clk: spear: Remove uninitialized_var() usage
Using uninitialized_var() is dangerous as it papers over real bugs[1]
(or can in the future), and suppresses unrelated compiler warnings (e.g.
"unused variable"). If the compiler thinks it is uninitialized, either
simply initialize the variable or make compiler changes. As a precursor
to removing[2] this[3] macro[4], initialize "i" to zero. The compiler
warning was not a false positive, since clk_pll_set_rate()'s call to
clk_pll_round_rate_index() will always fail (since "prate" is NULL), so
"i" was never being initialized.

[1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
[2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
[3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
[4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

Fixes: 7d4998f71b ("clk: SPEAr: Vco-pll: Fix compilation warning")
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
2020-07-16 12:32:26 -07:00
..
clk-aux-synth.c
clk-frac-synth.c clk: SPEAr: pr_err() strings should end with newlines 2017-12-06 22:39:57 -08:00
clk-gpt-synth.c SPEAr: clk: pr_err() strings should end with newlines 2017-12-06 22:39:59 -08:00
clk-vco-pll.c clk: spear: Remove uninitialized_var() usage 2020-07-16 12:32:26 -07:00
clk.c
clk.h
Makefile
spear3xx_clock.c
spear6xx_clock.c clk: spear: fix WDT clock definition on SPEAr600 2018-04-06 13:45:34 -07:00
spear1310_clock.c
spear1340_clock.c clk: spear: Make structure i2s_sclk_masks constant 2019-09-06 10:27:40 -07:00