Skip to content

Commit

Permalink
drivers: clock_control: stm32: clean up unnecessary code
Browse files Browse the repository at this point in the history
This commit removes unnecessary initialization of the local variable
where its value is guaranteed to be overwritten by subsequent operations.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
  • Loading branch information
ndrs-pst authored and carlescufi committed May 27, 2024
1 parent 37466ac commit 512c183
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions drivers/clock_control/clock_stm32_ll_h5.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,8 @@ static void set_up_fixed_clock_sources(void)

int stm32_clock_control_init(const struct device *dev)
{
uint32_t old_hclk_freq = 0;
int r = 0;
uint32_t old_hclk_freq;
int r;

ARG_UNUSED(dev);

Expand Down
4 changes: 2 additions & 2 deletions drivers/clock_control/clock_stm32_ll_h7.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ int stm32_clock_control_init(const struct device *dev)
int r = 0;

#if defined(CONFIG_CPU_CORTEX_M7)
uint32_t old_hclk_freq = 0;
uint32_t new_hclk_freq = 0;
uint32_t old_hclk_freq;
uint32_t new_hclk_freq;

/* HW semaphore Clock enable */
#if defined(CONFIG_SOC_STM32H7A3XX) || defined(CONFIG_SOC_STM32H7A3XXQ) || \
Expand Down
4 changes: 2 additions & 2 deletions drivers/clock_control/clock_stm32_ll_u5.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ static void set_up_fixed_clock_sources(void)

int stm32_clock_control_init(const struct device *dev)
{
uint32_t old_hclk_freq = 0;
int r = 0;
uint32_t old_hclk_freq;
int r;

ARG_UNUSED(dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_wba.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ static void set_up_fixed_clock_sources(void)
int stm32_clock_control_init(const struct device *dev)
{
uint32_t old_flash_freq;
int r = 0;
int r;

ARG_UNUSED(dev);

Expand Down

0 comments on commit 512c183

Please sign in to comment.