Skip to content

Commit ed14d36

Browse files
geertuthierryreding
authored andcommitted
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: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent f486673 commit ed14d36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-rcar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns,
110110
unsigned long clk_rate = clk_get_rate(rp->clk);
111111
u32 cyc, ph;
112112

113-
one_cycle = (unsigned long long)NSEC_PER_SEC * 100ULL * (1 << div);
113+
one_cycle = NSEC_PER_SEC * 100ULL << div;
114114
do_div(one_cycle, clk_rate);
115115

116116
tmp = period_ns * 100ULL;

0 commit comments

Comments
 (0)