diff mbox series

clk: socfpga: remove redundant assignment on division

Message ID 20211221003750.212780-1-colin.i.king@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series clk: socfpga: remove redundant assignment on division | expand

Commit Message

Colin Ian King Dec. 21, 2021, 12:37 a.m. UTC
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.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/clk/socfpga/clk-pll-s10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dinh Nguyen Dec. 27, 2021, 10:38 a.m. UTC | #1
On 12/20/21 6:37 PM, Colin Ian King wrote:
> 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.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   drivers/clk/socfpga/clk-pll-s10.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/socfpga/clk-pll-s10.c b/drivers/clk/socfpga/clk-pll-s10.c
> index 70076a80149d..e444e4a0ee53 100644
> --- a/drivers/clk/socfpga/clk-pll-s10.c
> +++ b/drivers/clk/socfpga/clk-pll-s10.c
> @@ -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;
>   }
>   

Acked-by: Dinh Nguyen <dinguyen@kernel.org>
Stephen Boyd Jan. 6, 2022, 12:32 a.m. UTC | #2
Quoting Colin Ian King (2021-12-20 16:37:50)
> 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.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/socfpga/clk-pll-s10.c b/drivers/clk/socfpga/clk-pll-s10.c
index 70076a80149d..e444e4a0ee53 100644
--- a/drivers/clk/socfpga/clk-pll-s10.c
+++ b/drivers/clk/socfpga/clk-pll-s10.c
@@ -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;
 }