summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2022-08-30 00:03:12 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-01 22:41:45 +0000
commit2e864b253903b8fbcfa509113be2407e76daea2e (patch)
treee383593749ba7d726dcdb45e30c2098a47bb4a05 /power
parent76789c78aff4a73c2dc0aca526267714fffb075b (diff)
downloadchrome-ec-2e864b253903b8fbcfa509113be2407e76daea2e.tar.gz
tree-wide: const-ify argv for console commands
This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/common.c12
-rw-r--r--power/host_sleep.c2
-rw-r--r--power/mt817x.c2
-rw-r--r--power/qcom.c4
-rw-r--r--power/rk3288.c2
-rw-r--r--power/sdm845.c2
6 files changed, 12 insertions, 12 deletions
diff --git a/power/common.c b/power/common.c
index 256a60d0b1..284e8cd933 100644
--- a/power/common.c
+++ b/power/common.c
@@ -903,7 +903,7 @@ inline void power_set_pause_in_s5(int pause)
/*****************************************************************************/
/* Console commands */
-static int command_powerinfo(int argc, char **argv)
+static int command_powerinfo(int argc, const char **argv)
{
/*
* Print power state in same format as state machine. This is
@@ -918,7 +918,7 @@ DECLARE_CONSOLE_COMMAND(powerinfo, command_powerinfo, NULL,
"Show current power state");
#ifdef CONFIG_CMD_POWERINDEBUG
-static int command_powerindebug(int argc, char **argv)
+static int command_powerindebug(int argc, const char **argv)
{
const struct power_signal_info *s = power_signal_list;
int i;
@@ -954,7 +954,7 @@ DECLARE_CONSOLE_COMMAND(powerindebug, command_powerindebug, "[mask]",
#ifdef CONFIG_CMD_S5_TIMEOUT
/* Allow command-line access to configure our S5 delay for power testing */
-static int command_s5_timeout(int argc, char **argv)
+static int command_s5_timeout(int argc, const char **argv)
{
char *e;
@@ -977,7 +977,7 @@ DECLARE_CONSOLE_COMMAND(s5_timeout, command_s5_timeout, "[sec]",
#endif
#ifdef CONFIG_HIBERNATE
-static int command_hibernation_delay(int argc, char **argv)
+static int command_hibernation_delay(int argc, const char **argv)
{
char *e;
uint32_t time_g3 =
@@ -1054,7 +1054,7 @@ host_command_pause_in_s5(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_GSV_PAUSE_IN_S5, host_command_pause_in_s5,
EC_VER_MASK(0));
-static int command_pause_in_s5(int argc, char **argv)
+static int command_pause_in_s5(int argc, const char **argv)
{
if (argc > 1 && !parse_bool(argv[1], &pause_in_s5))
return EC_ERROR_INVAL;
@@ -1123,7 +1123,7 @@ DECLARE_HOOK(HOOK_SYSJUMP, preserve_enable_5v_state, HOOK_PRIO_DEFAULT);
#endif /* defined(CONFIG_POWER_PP5000_CONTROL) */
#ifdef CONFIG_POWERSEQ_FAKE_CONTROL
-static int command_power_fake(int argc, char **argv)
+static int command_power_fake(int argc, const char **argv)
{
if (argc < 2) {
ccprints("Error: Argument required");
diff --git a/power/host_sleep.c b/power/host_sleep.c
index 28d3f506a1..bba21706ee 100644
--- a/power/host_sleep.c
+++ b/power/host_sleep.c
@@ -211,7 +211,7 @@ void sleep_reset_tracking(void)
timeout_hang_type = SLEEP_HANG_NONE;
}
-static int command_sleep_fail_timeout(int argc, char **argv)
+static int command_sleep_fail_timeout(int argc, const char **argv)
{
if (argc < 2) {
/* no arguments - just print the current timeout */
diff --git a/power/mt817x.c b/power/mt817x.c
index f27c960bd6..99f83d0808 100644
--- a/power/mt817x.c
+++ b/power/mt817x.c
@@ -792,7 +792,7 @@ static const char *const state_name[] = {
"on",
};
-static int command_power(int argc, char **argv)
+static int command_power(int argc, const char **argv)
{
int v;
diff --git a/power/qcom.c b/power/qcom.c
index 549792b2ed..6a98350814 100644
--- a/power/qcom.c
+++ b/power/qcom.c
@@ -904,7 +904,7 @@ void chipset_reset(enum chipset_shutdown_reason reason)
*/
static int fake_suspend = -1;
-static int command_fake_suspend(int argc, char **argv)
+static int command_fake_suspend(int argc, const char **argv)
{
int v;
@@ -1204,7 +1204,7 @@ static const char *const state_name[] = {
"on",
};
-test_mockable_static int command_power(int argc, char **argv)
+test_mockable_static int command_power(int argc, const char **argv)
{
int v;
diff --git a/power/rk3288.c b/power/rk3288.c
index ecdc1f2200..ad56ef585e 100644
--- a/power/rk3288.c
+++ b/power/rk3288.c
@@ -546,7 +546,7 @@ static const char *const state_name[] = {
"on",
};
-static int command_power(int argc, char **argv)
+static int command_power(int argc, const char **argv)
{
int v;
diff --git a/power/sdm845.c b/power/sdm845.c
index 7dc8c4d14a..42d082dbd6 100644
--- a/power/sdm845.c
+++ b/power/sdm845.c
@@ -857,7 +857,7 @@ static const char *const state_name[] = {
"on",
};
-static int command_power(int argc, char **argv)
+static int command_power(int argc, const char **argv)
{
int v;