From: Chanwoo Choi Date: Fri, 14 Jul 2017 02:47:55 +0000 (+0900) Subject: pass: hal: Move get_time_ms() pass-hal.c to pass-pmqos.c X-Git-Tag: accepted/tizen/4.0/unified/20170816.011839~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F20%2F139920%2F1;p=platform%2Fcore%2Fsystem%2Fpass.git pass: hal: Move get_time_ms() pass-hal.c to pass-pmqos.c The existing get_time_ms() is only used on pass-pmqos.c. So, this patch moves the definition of get_time_ms() from pass-hal.c to pass-pmqos.c. Change-Id: Ic89cb705071633b5093722a4ab26e71133c444cb Signed-off-by: Chanwoo Choi --- diff --git a/src/pass/pass-hal.c b/src/pass/pass-hal.c index fb07fc1..7fa470f 100644 --- a/src/pass/pass-hal.c +++ b/src/pass/pass-hal.c @@ -886,13 +886,3 @@ int pass_get_cpu_stats(struct pass_policy *policy) return 0; } - -/* Return current time (unit: millisecond) */ -int64_t pass_get_time_ms(void) -{ - struct timeval now; - - gettimeofday(&now, NULL); - - return ((int64_t) now.tv_sec * 1000 + (int64_t) now.tv_usec / 1000); -} diff --git a/src/pass/pass-hal.h b/src/pass/pass-hal.h index 80a75a8..c430419 100644 --- a/src/pass/pass-hal.h +++ b/src/pass/pass-hal.h @@ -76,7 +76,6 @@ int pass_set_online_max_num(struct pass_resource *res, int num); * These functions will be altered by the standard interface on later. */ int pass_get_cpu_stats(struct pass_policy *policy); -int64_t pass_get_time_ms(void); /*** * Functions for Nonstandard H/W resources diff --git a/src/pass/pass-pmqos.c b/src/pass/pass-pmqos.c index 94ba989..47417d9 100644 --- a/src/pass/pass-pmqos.c +++ b/src/pass/pass-pmqos.c @@ -23,7 +23,6 @@ #include "pass.h" #include "pass-gov.h" -#include "pass-hal.h" #include "core/device-notifier.h" #include "core/config-parser.h" @@ -36,6 +35,15 @@ #define PASS_LOCK "Lock" #define PASS_UNLOCK "Unlock" +static int64_t get_time_ms(void) +{ + struct timeval now; + + gettimeofday(&now, NULL); + + return ((int64_t) now.tv_sec * 1000 + (int64_t) now.tv_usec / 1000); +} + /* * is_pmqos_enabled - Check state of whether to support PM_QOS for scenario * @policy: instance of pass_policy structure @@ -188,11 +196,11 @@ int pass_notifier_pmqos_func(struct pass_policy *policy, void *data) _I("Lock '%s' scenario for '%s' resource\n", name, cdata->res_name); - scenario->list[index].locked_time = pass_get_time_ms(); + scenario->list[index].locked_time = get_time_ms(); } else { _I("UnLock '%s' scenario for '%s' resource (%lldms)\n", name, cdata->res_name, - (pass_get_time_ms() - scenario->list[index].locked_time)); + (get_time_ms() - scenario->list[index].locked_time)); scenario->list[index].locked_time = 0; }