summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2016-07-16 02:15:14 +0100
committerSteve Kondik <shade@chemlab.org>2016-07-18 04:56:34 -0700
commit5113c19a0a502db098780101dd10d811c56a885e (patch)
tree87345ee1191b73069276176321b67a9018a4f775
parentac2ef6c927a34057cac0fb040f461979624c6ba9 (diff)
power: 8996: Fix only sending the first pair out of every perf profile
When acquiring the perflock, we were only passing the first pair of arguments out of every profile. Because... sizeof(*)/sizeof(int) is always 2 on a 64bit arch. There's no need to put the profile into a pointer anyway, just pass it directly to ARRAY_SIZE (and the lock) Change-Id: I25f2a9b059290c3a0b36fc8dc29c711da938430e
-rw-r--r--power/power-8996.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/power/power-8996.c b/power/power-8996.c
index 809157b..1edb2fd 100644
--- a/power/power-8996.c
+++ b/power/power-8996.c
@@ -95,27 +95,23 @@ static void set_power_profile(int profile) {
}
if (profile == PROFILE_POWER_SAVE) {
- int *resource_values = profile_power_save;
- perform_hint_action(DEFAULT_PROFILE_HINT_ID, resource_values,
- ARRAY_SIZE(resource_values));
+ perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_power_save,
+ ARRAY_SIZE(profile_power_save));
ALOGD("%s: Set powersave mode", __func__);
} else if (profile == PROFILE_HIGH_PERFORMANCE) {
- int *resource_values = profile_high_performance;
- perform_hint_action(DEFAULT_PROFILE_HINT_ID, resource_values,
- ARRAY_SIZE(resource_values));
+ perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_high_performance,
+ ARRAY_SIZE(profile_high_performance));
ALOGD("%s: Set performance mode", __func__);
} else if (profile == PROFILE_BIAS_POWER) {
- int *resource_values = profile_bias_power;
- perform_hint_action(DEFAULT_PROFILE_HINT_ID, resource_values,
- ARRAY_SIZE(resource_values));
+ perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_bias_power,
+ ARRAY_SIZE(profile_bias_power));
ALOGD("%s: Set bias power mode", __func__);
} else if (profile == PROFILE_BIAS_PERFORMANCE) {
- int *resource_values = profile_bias_performance;
- perform_hint_action(DEFAULT_PROFILE_HINT_ID, resource_values,
- ARRAY_SIZE(resource_values));
+ perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_bias_performance,
+ ARRAY_SIZE(profile_bias_performance));
ALOGD("%s: Set bias perf mode", __func__);
}