pass: pmqos: Remove the duplicate conditional statement 75/114175/2
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 10 Feb 2017 05:01:41 +0000 (14:01 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 13 Feb 2017 01:13:14 +0000 (10:13 +0900)
The pass_notifier_pmqos_func has the duplicate 'if' statement
for locked state. This patch removes the duplicate conditional statement.

And, this patch moves the call of pass_governor_change_level_scope()
before prining the locked/unlocked log in order to provide the
more correct timing information.

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

index 159c0f4..8c972ff 100644 (file)
@@ -158,9 +158,6 @@ int pass_notifier_pmqos_func(struct pass_policy *policy, void *data)
        }
        scenario->list[index].locked = locked;
 
-       if (locked)
-               scenario->list[index].locked_time = pass_get_time_ms();
-
        /* Change scaling scope according to scenario's level */
        for (i = 0; i < scenario->num_scenarios; i++) {
                struct pass_scenario *scn = &scenario->list[i];
@@ -182,9 +179,13 @@ int pass_notifier_pmqos_func(struct pass_policy *policy, void *data)
                max_level = policy->default_max_level;
        }
 
+       pass_governor_change_level_scope(policy, min_level, max_level);
+
        if (locked) {
                _I("Lock   '%s' scenario for '%s' resource\n",
                        name, cdata->res_name);
+
+               scenario->list[index].locked_time = pass_get_time_ms();
        } else {
                _I("UnLock '%s' scenario for '%s' resource (%lldms)\n",
                        name, cdata->res_name,
@@ -193,7 +194,5 @@ int pass_notifier_pmqos_func(struct pass_policy *policy, void *data)
                scenario->list[index].locked_time = 0;
        }
 
-       pass_governor_change_level_scope(policy, min_level, max_level);
-
        return 0;
 }