Skip to content

Commit 512c183

Browse files
ndrs-pstcarlescufi
authored andcommitted
drivers: clock_control: stm32: clean up unnecessary code
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]>
1 parent 37466ac commit 512c183

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

drivers/clock_control/clock_stm32_ll_h5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ static void set_up_fixed_clock_sources(void)
696696

697697
int stm32_clock_control_init(const struct device *dev)
698698
{
699-
uint32_t old_hclk_freq = 0;
700-
int r = 0;
699+
uint32_t old_hclk_freq;
700+
int r;
701701

702702
ARG_UNUSED(dev);
703703

drivers/clock_control/clock_stm32_ll_h7.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,8 @@ int stm32_clock_control_init(const struct device *dev)
835835
int r = 0;
836836

837837
#if defined(CONFIG_CPU_CORTEX_M7)
838-
uint32_t old_hclk_freq = 0;
839-
uint32_t new_hclk_freq = 0;
838+
uint32_t old_hclk_freq;
839+
uint32_t new_hclk_freq;
840840

841841
/* HW semaphore Clock enable */
842842
#if defined(CONFIG_SOC_STM32H7A3XX) || defined(CONFIG_SOC_STM32H7A3XXQ) || \

drivers/clock_control/clock_stm32_ll_u5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,8 @@ static void set_up_fixed_clock_sources(void)
804804

805805
int stm32_clock_control_init(const struct device *dev)
806806
{
807-
uint32_t old_hclk_freq = 0;
808-
int r = 0;
807+
uint32_t old_hclk_freq;
808+
int r;
809809

810810
ARG_UNUSED(dev);
811811

drivers/clock_control/clock_stm32_ll_wba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static void set_up_fixed_clock_sources(void)
510510
int stm32_clock_control_init(const struct device *dev)
511511
{
512512
uint32_t old_flash_freq;
513-
int r = 0;
513+
int r;
514514

515515
ARG_UNUSED(dev);
516516

0 commit comments

Comments
 (0)