diff options
| author | Geert Uytterhoeven <[email protected]> | 2022-02-21 16:28:16 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2022-02-24 14:14:56 +0000 |
| commit | ed14d36498c8d15be098df4af9ca324f96e9de74 (patch) | |
| tree | fdd5a283dd7686b7266535c6189551e1f809d09a /drivers/pwm/pwm-rcar.c | |
| parent | dt-bindings: pwm: renesas,tpu: Do not require pwm-cells twice (diff) | |
| download | kernel-ed14d36498c8d15be098df4af9ca324f96e9de74.tar.gz kernel-ed14d36498c8d15be098df4af9ca324f96e9de74.zip | |
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 <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-rcar.c')
| -rw-r--r-- | drivers/pwm/pwm-rcar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c index b437192380e2..55f46d09602b 100644 --- a/drivers/pwm/pwm-rcar.c +++ b/drivers/pwm/pwm-rcar.c @@ -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; |
