Skip to content

Commit f3e4b14

Browse files
Guru Das Srinageshthierryreding
authored andcommitted
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 <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 899c537 commit f3e4b14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwmon/pwm-fan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static int pwm_fan_resume(struct device *dev)
447447
return 0;
448448

449449
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);
451451
ret = pwm_config(ctx->pwm, duty, pargs.period);
452452
if (ret)
453453
return ret;

0 commit comments

Comments
 (0)