summaryrefslogtreecommitdiff
path: root/zephyr/shim/src
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 /zephyr/shim/src
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 'zephyr/shim/src')
-rw-r--r--zephyr/shim/src/console.c4
-rw-r--r--zephyr/shim/src/i2c.c2
-rw-r--r--zephyr/shim/src/rtc.c4
-rw-r--r--zephyr/shim/src/system.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c
index edd729efb7..1c5aa44e99 100644
--- a/zephyr/shim/src/console.c
+++ b/zephyr/shim/src/console.c
@@ -202,7 +202,7 @@ void uart_shell_start(void)
}
#ifdef CONFIG_SHELL_HELP
-static void print_console_help(char *name,
+static void print_console_help(const char *name,
const struct zephyr_console_command *command)
{
if (command->help)
@@ -213,7 +213,7 @@ static void print_console_help(char *name,
#endif
int zshim_run_ec_console_command(const struct zephyr_console_command *command,
- size_t argc, char **argv)
+ size_t argc, const char **argv)
{
int ret;
diff --git a/zephyr/shim/src/i2c.c b/zephyr/shim/src/i2c.c
index 346665f0c2..8339f499f3 100644
--- a/zephyr/shim/src/i2c.c
+++ b/zephyr/shim/src/i2c.c
@@ -75,7 +75,7 @@ int i2c_get_port_from_remote_port(int remote_port)
}
#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_I2C_PORTMAP
-static int command_i2c_portmap(int argc, char **argv)
+static int command_i2c_portmap(int argc, const char **argv)
{
int i;
diff --git a/zephyr/shim/src/rtc.c b/zephyr/shim/src/rtc.c
index 9627089f2e..f79c5b94e1 100644
--- a/zephyr/shim/src/rtc.c
+++ b/zephyr/shim/src/rtc.c
@@ -135,7 +135,7 @@ void print_system_rtc(enum console_channel ch)
* chip-specific code. We should factor out the common parts.
*/
#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC
-static int command_system_rtc(int argc, char **argv)
+static int command_system_rtc(int argc, const char **argv)
{
if (argc == 3 && !strcasecmp(argv[1], "set")) {
char *e;
@@ -160,7 +160,7 @@ DECLARE_CONSOLE_COMMAND(rtc, command_system_rtc, "[set <seconds>]",
/**
* Test the RTC alarm by setting an interrupt on RTC match.
*/
-static int command_rtc_alarm_test(int argc, char **argv)
+static int command_rtc_alarm_test(int argc, const char **argv)
{
int s = 1, us = 0;
char *e;
diff --git a/zephyr/shim/src/system.c b/zephyr/shim/src/system.c
index f4a105ddd7..0d69a915df 100644
--- a/zephyr/shim/src/system.c
+++ b/zephyr/shim/src/system.c
@@ -160,7 +160,7 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds)
/**
* Print low power idle statistics
*/
-static int command_idle_stats(int argc, char **argv)
+static int command_idle_stats(int argc, const char **argv)
{
const struct device *sys_dev = device_get_binding("CROS_SYSTEM");