Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Thierry Reding
ed14d364 f4866732

+1 -1
+1 -1
drivers/pwm/pwm-rcar.c
··· 110 110 unsigned long clk_rate = clk_get_rate(rp->clk); 111 111 u32 cyc, ph; 112 112 113 - one_cycle = (unsigned long long)NSEC_PER_SEC * 100ULL * (1 << div); 113 + one_cycle = NSEC_PER_SEC * 100ULL << div; 114 114 do_div(one_cycle, clk_rate); 115 115 116 116 tmp = period_ns * 100ULL;