diff options
author | Caveh Jalali <caveh@chromium.org> | 2022-08-30 00:03:12 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-01 22:41:45 +0000 |
commit | 2e864b253903b8fbcfa509113be2407e76daea2e (patch) | |
tree | e383593749ba7d726dcdb45e30c2098a47bb4a05 /common/host_command.c | |
parent | 76789c78aff4a73c2dc0aca526267714fffb075b (diff) | |
download | chrome-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 'common/host_command.c')
-rw-r--r-- | common/host_command.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/host_command.c b/common/host_command.c index 78b15ea2bb..2399dcb236 100644 --- a/common/host_command.c +++ b/common/host_command.c @@ -800,7 +800,7 @@ DECLARE_HOST_COMMAND(EC_CMD_GET_FEATURES, host_command_get_features, /* Console commands */ #ifdef CONFIG_CMD_HOSTCMD -static int parse_byte(char *b, uint8_t *out) +static int parse_byte(const char *b, uint8_t *out) { int i; *out = 0; @@ -819,7 +819,7 @@ static int parse_byte(char *b, uint8_t *out) return EC_SUCCESS; } -static int parse_params(char *s, uint8_t *params) +static int parse_params(const char *s, uint8_t *params) { int len = 0; @@ -833,7 +833,7 @@ static int parse_params(char *s, uint8_t *params) return len; } -static int command_host_command(int argc, char **argv) +static int command_host_command(int argc, const char **argv) { struct host_cmd_handler_args args; char *cmd_params; @@ -905,7 +905,7 @@ DECLARE_CONSOLE_COMMAND(hostcmd, command_host_command, "cmd ver param", #endif /* CONFIG_CMD_HOSTCMD */ #ifdef CONFIG_CMD_HCDEBUG -static int command_hcdebug(int argc, char **argv) +static int command_hcdebug(int argc, const char **argv) { if (argc >= 3) return EC_ERROR_PARAM_COUNT; |