Commit ed14d364 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Thierry Reding
Browse files

pwm: rcar: Simplify multiplication/shift logic



- Remove the superfluous cast; the multiplication will yield a 64-bit
    result due to the "100ULL" anyway,
  - "a * (1 << b)" == "a << b".

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent f4866732
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns,
	unsigned long clk_rate = clk_get_rate(rp->clk);
	u32 cyc, ph;

	one_cycle = (unsigned long long)NSEC_PER_SEC * 100ULL * (1 << div);
	one_cycle = NSEC_PER_SEC * 100ULL << div;
	do_div(one_cycle, clk_rate);

	tmp = period_ns * 100ULL;