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

hwmon: pwm-fan: Use 64-bit division macro

Since the PWM framework is switching struct pwm_args.period's datatype
to u64, prepare for this transition by using DIV_ROUND_UP_ULL to handle
a 64-bit dividend.

Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Guru Das Srinagesh and committed by
Thierry Reding
f3e4b141 899c537c

+1 -1
+1 -1
drivers/hwmon/pwm-fan.c
··· 447 447 return 0; 448 448 449 449 pwm_get_args(ctx->pwm, &pargs); 450 - duty = DIV_ROUND_UP(ctx->pwm_value * (pargs.period - 1), MAX_PWM); 450 + duty = DIV_ROUND_UP_ULL(ctx->pwm_value * (pargs.period - 1), MAX_PWM); 451 451 ret = pwm_config(ctx->pwm, duty, pargs.period); 452 452 if (ret) 453 453 return ret;