Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aeb4a311 authored by Amit Pundir's avatar Amit Pundir Committed by John Stultz
Browse files

sched/walt: use do_div instead of division operator



Use do_div() instead of "/" operator to fix undefined references to
"__aeabi_uldivmod" build error for ARCH=arm.

Also in TP_fast_assign(), along with do_div() usage,  replace "," with
";" which would have resulted in a syntax error (!), because
'#define TP_fast_assign(args...) args' would have stripped off the ","
and left white space between these two assignments after CPP phase.

Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
[jstultz: Cherry-picked from common/android-3.18]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 6c7e03dd
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1057,7 +1057,8 @@ TRACE_EVENT(walt_update_history,
		__entry->samples        = samples;
		__entry->samples        = samples;
		__entry->evt            = evt;
		__entry->evt            = evt;
		__entry->demand         = p->ravg.demand;
		__entry->demand         = p->ravg.demand;
		__entry->walt_avg = (__entry->demand << 10) / walt_ravg_window,
		__entry->walt_avg	= (__entry->demand << 10);
		do_div(__entry->walt_avg, walt_ravg_window);
		__entry->pelt_avg	= p->se.avg.util_avg;
		__entry->pelt_avg	= p->se.avg.util_avg;
		memcpy(__entry->hist, p->ravg.sum_history,
		memcpy(__entry->hist, p->ravg.sum_history,
					RAVG_HIST_SIZE_MAX * sizeof(u32));
					RAVG_HIST_SIZE_MAX * sizeof(u32));
+4 −3
Original line number Original line Diff line number Diff line
@@ -1577,9 +1577,10 @@ static inline unsigned long __cpu_util(int cpu, int delta)
	unsigned long capacity = capacity_orig_of(cpu);
	unsigned long capacity = capacity_orig_of(cpu);


#ifdef CONFIG_SCHED_WALT
#ifdef CONFIG_SCHED_WALT
	if (!walt_disabled && sysctl_sched_use_walt_cpu_util)
	if (!walt_disabled && sysctl_sched_use_walt_cpu_util) {
		util = (cpu_rq(cpu)->prev_runnable_sum << SCHED_LOAD_SHIFT) /
		util = cpu_rq(cpu)->prev_runnable_sum << SCHED_LOAD_SHIFT;
			walt_ravg_window;
		do_div(util, walt_ravg_window);
	}
#endif
#endif
	delta += util;
	delta += util;
	if (delta < 0)
	if (delta < 0)