summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Altensen <info@stricted.net>2019-09-22 23:50:37 +0200
committerJan Altensen <info@stricted.net>2020-04-09 16:40:38 +0200
commit92126914d057746b062a9e0cf4c80bd214ae78d5 (patch)
treea06a1415ea8fcc53dbdfe38cef4f1b0af899a0ba
parent763f86d784346f52ca5d238cf7ef21692a48749b (diff)
downloadandroid_hardware_samsung-lineage-16.0.tar.gz
android_hardware_samsung-lineage-16.0.tar.bz2
android_hardware_samsung-lineage-16.0.zip
power: properly initialize cluster stateslineage-16.0
this fixes the following error hardware/samsung/power/power.c:415:51: error: excess elements in array initializer [-Werror] char ON[CLUSTER_COUNT][PARAM_MAXLEN] = {"1", "1"}; when only one cluster is defined Change-Id: I49f88297afb8d57d8abd309e22fa667134b7e406
-rw-r--r--power/power.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/power/power.c b/power/power.c
index f9b268c..bf861b4 100644
--- a/power/power.c
+++ b/power/power.c
@@ -167,13 +167,13 @@ static void cpu_interactive_read(const char *param, char s[CLUSTER_COUNT][PARAM_
}
}
-static void cpu_interactive_write(const char *param, char s[CLUSTER_COUNT][PARAM_MAXLEN])
+static void cpu_interactive_write(const char *param, char *s)
{
char path[PATH_MAX];
for (unsigned int i = 0; i < ARRAY_SIZE(CPU_INTERACTIVE_PATHS); i++) {
sprintf(path, "%s%s", CPU_INTERACTIVE_PATHS[i], param);
- sysfs_write(path, s[i]);
+ sysfs_write(path, s);
}
}
@@ -416,8 +416,6 @@ static void samsung_power_set_interactive(struct power_module *module, int on)
char button_state[2];
int rc;
static bool touchkeys_blocked = false;
- char ON[CLUSTER_COUNT][PARAM_MAXLEN] = {"1", "1"};
- char OFF[CLUSTER_COUNT][PARAM_MAXLEN] = {"0", "0"};
ALOGV("power_set_interactive: %d", on);
@@ -469,7 +467,7 @@ static void samsung_power_set_interactive(struct power_module *module, int on)
}
out:
- cpu_interactive_write(IO_IS_BUSY_PATH, on ? ON : OFF);
+ cpu_interactive_write(IO_IS_BUSY_PATH, on ? "1" : "0");
ALOGV("power_set_interactive: %d done", on);
}