pass: Move local constatnt definition to the specific module 99/158899/1
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 6 Nov 2017 01:29:38 +0000 (10:29 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 6 Nov 2017 01:29:38 +0000 (10:29 +0900)
The some definitions were only used in the specific module.
They would be not included in the pass.h header file. This patch
moves the definition to the specific module.
- #define PASS_MIN_GOV_TIMEOUT 0.2 (pass-parser.c)
- #define PASS_CPU_STATS_DEFAULT 20 (pass.c)

Change-Id: Id3ce5c81198d74981a50541b6b71495c48bab3c3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-parser.c
src/pass/pass.c
src/pass/pass.h

index e7eda1aecdcd103eec836bb75d40ec482d06623a..eb8e71a8280c90efd9e41e44228e43197086da01 100644 (file)
@@ -30,6 +30,7 @@
 
 #define BUFF_MAX                       255
 #define MAX_NUM                                255
+#define MIN_TIMEOUT_SEC                0.2
 
 static enum pass_state is_supported(char *value)
 {
@@ -181,8 +182,8 @@ static int pass_parse_level(struct parse_result *result,
        else if (MATCH(result->name, "gov_timeout")) {
                double gov_timeout = atof(result->value);
 
-               if (gov_timeout < PASS_MIN_GOV_TIMEOUT)
-                       gov_timeout = PASS_MIN_GOV_TIMEOUT;
+               if (gov_timeout < MIN_TIMEOUT_SEC)
+                       gov_timeout = MIN_TIMEOUT_SEC;
 
                policy->levels[level].gov_timeout = gov_timeout;
        }
@@ -238,8 +239,8 @@ static int pass_parse_core(struct parse_result *result, void *user_data)
        else if (MATCH(result->name, "pass_governor_timeout")) {
                policy->gov_timeout = atof(result->value);
 
-               if (PASS_MIN_GOV_TIMEOUT > policy->gov_timeout)
-                       policy->gov_timeout = PASS_MIN_GOV_TIMEOUT;
+               if (MIN_TIMEOUT_SEC > policy->gov_timeout)
+                       policy->gov_timeout = MIN_TIMEOUT_SEC;
        }
 
        if (policy->num_levels > 0 && !policy->levels) {
index 2af60b705e086aabbac399da098aa5a34ee41829..bb32453cc18fc081a6e89912f049e72076f1c77b 100644 (file)
@@ -42,6 +42,7 @@
 #define PASS_DEFAULT_CPU_THRESHOLD             20
 #define PASS_DEFAULT_LEVEL_UP_THRESHOLD                30
 #define PASS_DEFAULT_LEVEL_DOWN_THRESHOLD      80
+#define PASS_CPU_STATS_DEFAULT                 20
 
 static struct pass g_pass;
 static SystemPassCore *g_gdbus_instance = NULL;
index b959a70d634467d8d652014ace92920836b80472..892a2c220303cd0952ad91f37c01f0e04f980637 100644 (file)
@@ -31,8 +31,6 @@
  ******************************************************/
 #define PASS_NAME_LEN          128
 #define PASS_LEVEL_COND_MAX    3
-#define PASS_CPU_STATS_DEFAULT 20
-#define PASS_MIN_GOV_TIMEOUT   0.2
 
 struct pass_policy;