author: Daniel Lezcano <daniel.lezcano@linaro.org> 2020-12-30 16:37:44 +0100
committer: Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2020-12-30 18:47:33 +0100
commit: 8f50db4b5c79af2ba54f5fbe8a5173fd7f37a493
parent: 0e8f68d7f04856a9e2ad4817b477fa35124888bd
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 3 deletions
diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
index 5b6857e9b064..0abcc439d728 100644
--- a/drivers/powercap/dtpm.c
+++ b/drivers/powercap/dtpm.c
@@ -99,8 +99,8 @@ static void __dtpm_rebalance_weight(struct dtpm *dtpm)
pr_debug("Setting weight '%d' for '%s'\n",
child->weight, child->zone.name);
- child->weight = DIV_ROUND_CLOSEST(child->power_max * 1024,
- dtpm->power_max);
+ child->weight = DIV64_U64_ROUND_CLOSEST(
+ child->power_max * 1024, dtpm->power_max);
__dtpm_rebalance_weight(child);
}
@@ -272,7 +272,7 @@ static int __set_power_limit_uw(struct dtpm *dtpm, int cid, u64 power_limit)
} else if (power_limit == dtpm->power_min) {
power = child->power_min;
} else {
- power = DIV_ROUND_CLOSEST(
+ power = DIV_ROUND_CLOSEST_ULL(
power_limit * child->weight, 1024);
}