From 96eabab698769f02378cc005485c299a5b6beca6 Mon Sep 17 00:00:00 2001 From: zms123456 <85141075+zmshahaha@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:58:13 +0800 Subject: [PATCH] [components][drivers]fix some uninitialize err (#8806) fix some uninitialize err --- components/drivers/clk/clk.c | 2 +- components/drivers/ofw/base.c | 2 +- components/drivers/ofw/irq.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/drivers/clk/clk.c b/components/drivers/clk/clk.c index 17cf878466..053c67d0a6 100644 --- a/components/drivers/clk/clk.c +++ b/components/drivers/clk/clk.c @@ -1028,7 +1028,7 @@ rt_ssize_t rt_ofw_count_of_clk(struct rt_ofw_node *clk_ofw_np) if (prop) { - rt_uint32_t max_idx, idx; + rt_uint32_t max_idx = 0, idx; for (cell = rt_ofw_prop_next_u32(prop, RT_NULL, &idx); cell; diff --git a/components/drivers/ofw/base.c b/components/drivers/ofw/base.c index ffb513fbb7..8d629a9f67 100644 --- a/components/drivers/ofw/base.c +++ b/components/drivers/ofw/base.c @@ -870,7 +870,7 @@ struct rt_ofw_node *rt_ofw_get_cpu_node(int cpu, int *thread, rt_bool_t (*match_ rt_ofw_foreach_cpu_node(cpu_np) { - rt_ssize_t prop_len; + rt_ssize_t prop_len = 0; rt_bool_t is_end = RT_FALSE; int tid, addr_cells = rt_ofw_io_addr_cells(cpu_np); const fdt32_t *cell = rt_ofw_prop_read_raw(cpu_np, propname, &prop_len); diff --git a/components/drivers/ofw/irq.c b/components/drivers/ofw/irq.c index cf47f01ed2..d5b2fb5a30 100755 --- a/components/drivers/ofw/irq.c +++ b/components/drivers/ofw/irq.c @@ -43,7 +43,7 @@ static rt_err_t ofw_parse_irq_map(struct rt_ofw_node *np, struct rt_ofw_cell_arg struct rt_ofw_node *ic_np = RT_NULL; const fdt32_t *addr, *map, *map_mask; int child_address_cells, child_interrupt_cells; - int parent_address_cells, parent_interrupt_cells; + int parent_address_cells = 0, parent_interrupt_cells = 0; int addr_cells, pin_cells, icaddr_cells, idx1, idx2, limit; /*