diff options
| author | Steven Price <[email protected]> | 2022-11-10 11:45:48 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2022-11-11 14:03:59 +0000 |
| commit | dd1f1da4ada5d8ac774c2ebe97230637820b3323 (patch) | |
| tree | cffc4eb37456e1652795176066bb949698a7ff30 /drivers/pwm/pwm-stm32.c | |
| parent | pwm: tegra: Ensure the clock rate is not less than needed (diff) | |
| download | kernel-dd1f1da4ada5d8ac774c2ebe97230637820b3323.tar.gz kernel-dd1f1da4ada5d8ac774c2ebe97230637820b3323.zip | |
pwm: tegra: Fix 32 bit build
The value of NSEC_PER_SEC << PWM_DUTY_WIDTH doesn't fix within a 32 bit
integer causing a build warning/error (and the value truncated):
drivers/pwm/pwm-tegra.c: In function ‘tegra_pwm_config’:
drivers/pwm/pwm-tegra.c:148:53: error: result of ‘1000000000 << 8’ requires 39 bits to represent, but ‘long int’ only has 32 bits [-Werror=shift-overflow=]
148 | required_clk_rate = DIV_ROUND_UP_ULL(NSEC_PER_SEC << PWM_DUTY_WIDTH,
| ^~
Explicitly cast to a u64 to ensure the correct result.
Fixes: cfcb68817fb3 ("pwm: tegra: Improve required rate calculation")
Signed-off-by: Steven Price <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Reviewed-by: Jon Hunter <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-stm32.c')
0 files changed, 0 insertions, 0 deletions
