pass: hal: Move get_time_ms() pass-hal.c to pass-pmqos.c 20/139920/1
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 14 Jul 2017 02:47:55 +0000 (11:47 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 21 Jul 2017 05:17:36 +0000 (14:17 +0900)
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 <cw00.choi@samsung.com>
src/pass/pass-hal.c
src/pass/pass-hal.h
src/pass/pass-pmqos.c

index fb07fc1..7fa470f 100644 (file)
@@ -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);
-}
index 80a75a8..c430419 100644 (file)
@@ -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
index 94ba989..47417d9 100644 (file)
@@ -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"
 #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;
        }