The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/clk/uniphier/clk-uniphier-cpugear.c | 2 +-
drivers/clk/uniphier/clk-uniphier-fixed-factor.c | 2 +-
drivers/clk/uniphier/clk-uniphier-fixed-rate.c | 2 +-
drivers/clk/uniphier/clk-uniphier-gate.c | 2 +-
drivers/clk/uniphier/clk-uniphier-mux.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
@@ -79,7 +79,7 @@ struct clk_hw *uniphier_clk_register_cpugear(struct device *dev,
const struct uniphier_clk_cpugear_data *data)
{
struct uniphier_clk_cpugear *gear;
- struct clk_init_data init;
+ struct clk_init_data init = {};
int ret;
gear = devm_kzalloc(dev, sizeof(*gear), GFP_KERNEL);
@@ -13,8 +13,8 @@ struct clk_hw *uniphier_clk_register_fixed_factor(struct device *dev,
const char *name,
const struct uniphier_clk_fixed_factor_data *data)
{
+ struct clk_init_data init = {};
struct clk_fixed_factor *fix;
- struct clk_init_data init;
int ret;
fix = devm_kzalloc(dev, sizeof(*fix), GFP_KERNEL);
@@ -13,8 +13,8 @@ struct clk_hw *uniphier_clk_register_fixed_rate(struct device *dev,
const char *name,
const struct uniphier_clk_fixed_rate_data *data)
{
+ struct clk_init_data init = {};
struct clk_fixed_rate *fixed;
- struct clk_init_data init;
int ret;
/* allocate fixed-rate clock */
@@ -61,8 +61,8 @@ struct clk_hw *uniphier_clk_register_gate(struct device *dev,
const char *name,
const struct uniphier_clk_gate_data *data)
{
+ struct clk_init_data init = {};
struct uniphier_clk_gate *gate;
- struct clk_init_data init;
int ret;
gate = devm_kzalloc(dev, sizeof(*gate), GFP_KERNEL);
@@ -58,8 +58,8 @@ struct clk_hw *uniphier_clk_register_mux(struct device *dev,
const char *name,
const struct uniphier_clk_mux_data *data)
{
+ struct clk_init_data init = {};
struct uniphier_clk_mux *mux;
- struct clk_init_data init;
int ret;
mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);