sched: Fix possible overflow in cpu_cycles_to_freq()

Truncating period to u32 could lead to incorrect results. Make it u64
instead.

Change-Id: I5224a943e64bc6d64b6c8e614a01f798a6cdc796
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
Puja Gupta 2017-11-16 13:39:33 -08:00 committed by Pavankumar Kondeti
parent 55cc722ec6
commit 6e92713cba

View file

@ -1249,7 +1249,7 @@ static inline int cpu_min_power_cost(int cpu)
return cpu_rq(cpu)->cluster->min_power_cost; return cpu_rq(cpu)->cluster->min_power_cost;
} }
static inline u32 cpu_cycles_to_freq(u64 cycles, u32 period) static inline u32 cpu_cycles_to_freq(u64 cycles, u64 period)
{ {
return div64_u64(cycles, period); return div64_u64(cycles, period);
} }