Skip to contentSkip to conversation

clk: socfpga: remove redundant assignment on division

PATCH Applied Colin Ian King 3 participants 3 messages Dec 21, 2021 – Jan 6, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: socfpga: remove redundant assignment on division

The variable parent_rate is being divided by div and the result is re-assigned to parent_rate before being returned. The assignment is redundant, replace /= operator with just / operator.

---
 drivers/clk/socfpga/clk-pll-s10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/socfpga/clk-pll-s10.c +1 -1
index 70076a80149d..e444e4a0ee53 100644
@@ -113,7 +113,7 @@ static unsigned long clk_boot_clk_recalc_rate(struct clk_hw *hwclk,
 		SWCTRLBTCLKSEL_MASK) >>
 		SWCTRLBTCLKSEL_SHIFT);
 	div += 1;
-	return parent_rate /= div;
+	return parent_rate / div;
 }
 
 
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Colin Ian King

The variable parent_rate is being divided by div and the result is re-assigned to parent_rate before being returned. The assignment is redundant, replace /= operator with just / operator.

---
  drivers/clk/socfpga/clk-pll-s10.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/socfpga/clk-pll-s10.c +0 -0
index 70076a80149d..e444e4a0ee53 100644

drivers/clk/socfpga/clk-pll-s10.c static unsigned long clk_boot_clk_recalc_rate(struct clk_hw *hwclk, · line 118

Quoted 7 lines
drivers/clk/socfpga/clk-pll-s10.c +1 -1
@@ -113,7 +113,7 @@ static unsigned long clk_boot_clk_recalc_rate(struct clk_hw *hwclk,
  		SWCTRLBTCLKSEL_MASK) >>
  		SWCTRLBTCLKSEL_SHIFT);
  	div += 1;
-	return parent_rate /= div;
+	return parent_rate / div;
  }
 
maintainer Applied
#2 lore raw
In reply to Colin Ian King

Quoting Colin Ian King (2021-12-20 16:37:50)

Quoted 6 lines

The variable parent_rate is being divided by div and the result is re-assigned to parent_rate before being returned. The assignment is redundant, replace /= operator with just / operator.

---

Applied to clk-next