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 | |
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>
337 files changed, 569 insertions, 568 deletions
diff --git a/baseboard/honeybuns/baseboard.c b/baseboard/honeybuns/baseboard.c index 58d07168c8..add4b6d564 100644 --- a/baseboard/honeybuns/baseboard.c +++ b/baseboard/honeybuns/baseboard.c @@ -467,7 +467,7 @@ void baseboard_power_button_evt(int level) POWER_BUTTON_DEBOUNCE_USEC); } -static int command_pwr_btn(int argc, char **argv) +static int command_pwr_btn(int argc, const char **argv) { if (argc == 1) { task_set_event(TASK_ID_POWER_BUTTON, BUTTON_EVT_INFO); diff --git a/baseboard/honeybuns/usb_pd_policy.c b/baseboard/honeybuns/usb_pd_policy.c index a6a17c7ffb..7481eb90a9 100644 --- a/baseboard/honeybuns/usb_pd_policy.c +++ b/baseboard/honeybuns/usb_pd_policy.c @@ -69,7 +69,7 @@ static int src_host_pdo_cnt_override; #define PD_DR_SWAP_ATTEMPT_MAX 3 static int pd_dr_swap_attempt_count[CONFIG_USB_PD_PORT_MAX_COUNT]; -static int command_hostpdo(int argc, char **argv) +static int command_hostpdo(int argc, const char **argv) { char *e; int limit; diff --git a/baseboard/kalista/led.c b/baseboard/kalista/led.c index fc4a6ec8da..7e78065641 100644 --- a/baseboard/kalista/led.c +++ b/baseboard/kalista/led.c @@ -181,7 +181,7 @@ void led_critical(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/baseboard/kukui/charger_mt6370.c b/baseboard/kukui/charger_mt6370.c index 03077fdfa9..dfd14bf8e2 100644 --- a/baseboard/kukui/charger_mt6370.c +++ b/baseboard/kukui/charger_mt6370.c @@ -155,7 +155,7 @@ thermal_exit: thermal_wait_until.val = get_time().val + (3 * SECOND); } -static int command_jc(int argc, char **argv) +static int command_jc(int argc, const char **argv) { static int prev_jc_temp; int jc_temp; diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index 28cc8e69bd..10c11e3ea8 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -280,7 +280,7 @@ void board_print_temps(void) temps_interval * SECOND); } -static int command_temps_log(int argc, char **argv) +static int command_temps_log(int argc, const char **argv) { char *e = NULL; diff --git a/board/agah/board.c b/board/agah/board.c index b5c5a505eb..c2c6686b36 100644 --- a/board/agah/board.c +++ b/board/agah/board.c @@ -97,7 +97,7 @@ void board_power_interrupt(enum gpio_signal signal) hook_call_deferred(&bypass_pp3300_s5_deferred_data, 0); } -static int cc_blockseq(int argc, char *argv[]) +static int cc_blockseq(int argc, const char *argv[]) { if (argc > 1) { if (!parse_bool(argv[1], &block_sequence)) { diff --git a/board/ambassador/led.c b/board/ambassador/led.c index e140a393e3..36f7a127fa 100644 --- a/board/ambassador/led.c +++ b/board/ambassador/led.c @@ -216,7 +216,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/baklava/board.c b/board/baklava/board.c index c1972fc928..5b89a7cf61 100644 --- a/board/baklava/board.c +++ b/board/baklava/board.c @@ -322,7 +322,7 @@ void board_debug_gpio(enum debug_gpio trigger, int level, int pulse_usec) } } -static int command_dplane(int argc, char **argv) +static int command_dplane(int argc, const char **argv) { char *e; int lane; diff --git a/board/brask/led.c b/board/brask/led.c index c6264ee906..44f2fa4198 100644 --- a/board/brask/led.c +++ b/board/brask/led.c @@ -206,7 +206,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/c2d2/board.c b/board/c2d2/board.c index 922b8df921..2fbbaef433 100644 --- a/board/c2d2/board.c +++ b/board/c2d2/board.c @@ -77,7 +77,7 @@ static const char *lock_to_string(const enum bus_lock val) return names[val]; } -static int command_bus_status(int argc, char **argv) +static int command_bus_status(int argc, const char **argv) { if (argc > 1) return EC_ERROR_PARAM_COUNT; @@ -334,7 +334,7 @@ USB_SPI_CONFIG(usb_spi, USB_IFACE_SPI, USB_EP_SPI, /****************************************************************************** * Check parity setting on usarts. */ -static int command_uart_parity(int argc, char **argv) +static int command_uart_parity(int argc, const char **argv) { int parity = 0, newparity; struct usart_config const *usart; @@ -374,7 +374,7 @@ DECLARE_CONSOLE_COMMAND(parity, command_uart_parity, "usart[2|3|4] [0|1|2]", /****************************************************************************** * Set baud rate setting on usarts. */ -static int command_uart_baud(int argc, char **argv) +static int command_uart_baud(int argc, const char **argv) { int baud = 0; struct usart_config const *usart; @@ -406,7 +406,7 @@ DECLARE_CONSOLE_COMMAND(baud, command_uart_baud, "usart[2|3|4] rate", /****************************************************************************** * Hold the usart pins low while disabling it, or return it to normal. */ -static int command_hold_usart_low(int argc, char **argv) +static int command_hold_usart_low(int argc, const char **argv) { enum bus_lock *bus; enum gpio_signal rx; @@ -490,7 +490,7 @@ enum vref { PP3300 = 3300, }; -static int command_enable_spi(int argc, char **argv) +static int command_enable_spi(int argc, const char **argv) { static enum vref current_spi_vref_state; @@ -652,7 +652,7 @@ static inline int to_kbps(enum i2c_freq freq) } } -static int command_enable_i2c(int argc, char **argv) +static int command_enable_i2c(int argc, const char **argv) { int i2c_index; enum bus_lock *bus; @@ -736,7 +736,7 @@ DECLARE_CONSOLE_COMMAND(enable_i2c, command_enable_i2c, * Console commands for asserting H1 reset and EC Power button */ -static int command_vref_alternate(int argc, char **argv, +static int command_vref_alternate(int argc, const char **argv, const enum gpio_signal vref_signal, const enum gpio_signal en_signal, const int state_flag, @@ -792,7 +792,7 @@ busy_error_unlock: return EC_ERROR_BUSY; } -static int command_pwr_button(int argc, char **argv) +static int command_pwr_button(int argc, const char **argv) { return command_vref_alternate(argc, argv, GPIO_SPIVREF_HOLDN_ECVREF_H1_PWRBTN_ODL, @@ -802,13 +802,13 @@ static int command_pwr_button(int argc, char **argv) DECLARE_CONSOLE_COMMAND(pwr_button, command_pwr_button, "[0|1]?", "Get/set the power button state"); -static int command_h1_reset(int argc, char **argv) +static int command_h1_reset(int argc, const char **argv) { if ((argc == 2) && !strncasecmp("pulse", argv[1], strlen(argv[1]))) { int rv; int c = 2; - char *cmd_on[] = { "", "1", "" }; - char *cmd_off[] = { "", "0", "" }; + const char *cmd_on[] = { "", "1", "" }; + const char *cmd_off[] = { "", "0", "" }; rv = command_vref_alternate(c, cmd_on, GPIO_SPIVREF_RSVD_H1VREF_H1_RST_ODL, @@ -841,7 +841,7 @@ DECLARE_CONSOLE_COMMAND(h1_reset, command_h1_reset, "[0|1|pulse]?", static enum vref h1_vref; static enum vref ec_vref; -static int command_h1_vref_present(int argc, char **argv) +static int command_h1_vref_present(int argc, const char **argv) { ccprintf("H1 Vref: %s\n", h1_vref ? "on" : "off"); diff --git a/board/chronicler/board.c b/board/chronicler/board.c index eca532a58a..8d4639193c 100644 --- a/board/chronicler/board.c +++ b/board/chronicler/board.c @@ -427,7 +427,7 @@ DECLARE_HOOK(HOOK_INIT, battery_runtime_init, HOOK_PRIO_LAST); #ifdef BATTERY_RUNTIME_TEST /* test command */ -static int command_manual_run_time(int argc, char **argv) +static int command_manual_run_time(int argc, const char **argv) { char *e = NULL; diff --git a/board/coral/board.c b/board/coral/board.c index 445546828b..fac55b0d00 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -938,7 +938,7 @@ static void print_form_factor_list(int low, int high) } } -static int command_sku(int argc, char **argv) +static int command_sku(int argc, const char **argv) { enum adc_channel chan; diff --git a/board/dooly/led.c b/board/dooly/led.c index c8f0405260..22d2000f04 100644 --- a/board/dooly/led.c +++ b/board/dooly/led.c @@ -213,7 +213,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/elm/board.c b/board/elm/board.c index dcaca1b004..e01476e16c 100644 --- a/board/elm/board.c +++ b/board/elm/board.c @@ -250,7 +250,7 @@ void board_reset_pd_mcu(void) hook_call_deferred(&deferred_reset_pd_mcu_data, 10 * MSEC); } -static int command_pd_reset(int argc, char **argv) +static int command_pd_reset(int argc, const char **argv) { board_reset_pd_mcu(); return EC_SUCCESS; diff --git a/board/endeavour/led.c b/board/endeavour/led.c index 95d2592801..312d43921f 100644 --- a/board/endeavour/led.c +++ b/board/endeavour/led.c @@ -167,7 +167,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/endeavour/pse.c b/board/endeavour/pse.c index 9983c3fa52..afcb0e07dd 100644 --- a/board/endeavour/pse.c +++ b/board/endeavour/pse.c @@ -173,7 +173,7 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, pse_init, HOOK_PRIO_DEFAULT); /* Also reset the PSE on a reboot to toggle the power. */ DECLARE_HOOK(HOOK_CHIPSET_RESET, pse_init, HOOK_PRIO_DEFAULT); -static int command_pse(int argc, char **argv) +static int command_pse(int argc, const char **argv) { int port; diff --git a/board/eve/led.c b/board/eve/led.c index 0d3992347b..c7334efcab 100644 --- a/board/eve/led.c +++ b/board/eve/led.c @@ -632,7 +632,7 @@ void led_task(void *u) /******************************************************************/ /* Console commands */ -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { int side = LED_BOTH; char *e; diff --git a/board/fizz/led.c b/board/fizz/led.c index 3b67ce894e..6607ef299c 100644 --- a/board/fizz/led.c +++ b/board/fizz/led.c @@ -181,7 +181,7 @@ void led_critical(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/fluffy/board.c b/board/fluffy/board.c index 3935411af8..8765e32bd6 100644 --- a/board/fluffy/board.c +++ b/board/fluffy/board.c @@ -77,7 +77,7 @@ static void print_port_status(void) CPRINTS("USB MUX: %s", gpio_get_level(GPIO_EN_USB_MUX2) ? "ON" : "OFF"); } -static int command_cc_flip(int argc, char *argv[]) +static int command_cc_flip(int argc, const char *argv[]) { int enable; @@ -268,7 +268,7 @@ static void set_mux(enum usb_mux mux, uint8_t val) } /* This function assumes only 1 port works at a time. */ -static int command_portctl(int argc, char **argv) +static int command_portctl(int argc, const char **argv) { int port; int enable; @@ -333,7 +333,7 @@ DECLARE_CONSOLE_COMMAND(portctl, command_portctl, "<port# 0-19> <enable/disable>", "enable or disable a port"); -static int command_status(int argc, char **argv) +static int command_status(int argc, const char **argv) { int vbus_mv = adc_read_channel(ADC_PPVAR_VBUS_DUT); diff --git a/board/gaelin/led.c b/board/gaelin/led.c index ada7517d1c..386e7e6137 100644 --- a/board/gaelin/led.c +++ b/board/gaelin/led.c @@ -206,7 +206,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/genesis/led.c b/board/genesis/led.c index 92f88d4cd7..52a4f0f047 100644 --- a/board/genesis/led.c +++ b/board/genesis/led.c @@ -223,7 +223,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/genesis/pse.c b/board/genesis/pse.c index 9983c3fa52..afcb0e07dd 100644 --- a/board/genesis/pse.c +++ b/board/genesis/pse.c @@ -173,7 +173,7 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, pse_init, HOOK_PRIO_DEFAULT); /* Also reset the PSE on a reboot to toggle the power. */ DECLARE_HOOK(HOOK_CHIPSET_RESET, pse_init, HOOK_PRIO_DEFAULT); -static int command_pse(int argc, char **argv) +static int command_pse(int argc, const char **argv) { int port; diff --git a/board/hyperdebug/board.c b/board/hyperdebug/board.c index 746a84aa7e..9c6363127a 100644 --- a/board/hyperdebug/board.c +++ b/board/hyperdebug/board.c @@ -263,7 +263,7 @@ static enum gpio_signal find_signal_by_name(const char *name) /* * Set the mode of a GPIO pin: input/opendrain/pushpull. */ -static int command_gpio_mode(int argc, char **argv) +static int command_gpio_mode(int argc, const char **argv) { int gpio; int flags; @@ -297,7 +297,7 @@ DECLARE_CONSOLE_COMMAND_FLAGS(gpiomode, command_gpio_mode, /* * Set the weak pulling of a GPIO pin: up/down/none. */ -static int command_gpio_pull_mode(int argc, char **argv) +static int command_gpio_pull_mode(int argc, const char **argv) { int gpio; int flags; diff --git a/board/kinox/led.c b/board/kinox/led.c index dbcbf32859..2ddb14aa52 100644 --- a/board/kinox/led.c +++ b/board/kinox/led.c @@ -217,7 +217,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/kuldax/led.c b/board/kuldax/led.c index ada7517d1c..386e7e6137 100644 --- a/board/kuldax/led.c +++ b/board/kuldax/led.c @@ -206,7 +206,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/lindar/led.c b/board/lindar/led.c index b449cdc265..4c088c3bf0 100644 --- a/board/lindar/led.c +++ b/board/lindar/led.c @@ -662,7 +662,7 @@ static int help(const char *cmd) } #endif -static int command_lightbar(int argc, char **argv) +static int command_lightbar(int argc, const char **argv) { /* no args = dump lightbar status */ if (argc == 1) { diff --git a/board/mchpevb1/battery.c b/board/mchpevb1/battery.c index 03774a1170..74a08a66b5 100644 --- a/board/mchpevb1/battery.c +++ b/board/mchpevb1/battery.c @@ -214,7 +214,7 @@ enum ec_status charger_profile_override_set_param(uint32_t param, return EC_RES_INVALID_PARAM; } -static int command_fastcharge(int argc, char **argv) +static int command_fastcharge(int argc, const char **argv) { if (argc > 1 && !parse_bool(argv[1], &fast_charging_allowed)) return EC_ERROR_PARAM1; diff --git a/board/moli/led.c b/board/moli/led.c index d506864056..9a7d0fe516 100644 --- a/board/moli/led.c +++ b/board/moli/led.c @@ -226,7 +226,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_AMBER, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/moonbuggy/led.c b/board/moonbuggy/led.c index 9d728b5834..db1be04aef 100644 --- a/board/moonbuggy/led.c +++ b/board/moonbuggy/led.c @@ -218,7 +218,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/moonbuggy/pse.c b/board/moonbuggy/pse.c index 755e3c45e4..f268738895 100644 --- a/board/moonbuggy/pse.c +++ b/board/moonbuggy/pse.c @@ -172,7 +172,7 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, pse_init, HOOK_PRIO_DEFAULT); /* Also reset the PSE on a reboot to toggle the power. */ DECLARE_HOOK(HOOK_CHIPSET_RESET, pse_init, HOOK_PRIO_DEFAULT); -static int command_pse(int argc, char **argv) +static int command_pse(int argc, const char **argv) { int port; diff --git a/board/nami/led.c b/board/nami/led.c index ba0a2ef31c..859119b5c9 100644 --- a/board/nami/led.c +++ b/board/nami/led.c @@ -587,7 +587,7 @@ static void print_config(enum ec_led_id id) ccprintf(" Interval:%d\n", tick[id].interval); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_BATTERY_LED; static int alert = 0; diff --git a/board/nocturne/base_detect.c b/board/nocturne/base_detect.c index d84fcc45e3..75b4222e1a 100644 --- a/board/nocturne/base_detect.c +++ b/board/nocturne/base_detect.c @@ -361,7 +361,7 @@ void base_pwr_fault_interrupt(enum gpio_signal s) } } -static int command_basedetectdebug(int argc, char **argv) +static int command_basedetectdebug(int argc, const char **argv) { if ((argc > 1) && !parse_bool(argv[1], &debug)) return EC_ERROR_PARAM1; diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c index 545a1ed472..a8b02c66b7 100644 --- a/board/nucleo-f411re/board.c +++ b/board/nucleo-f411re/board.c @@ -115,7 +115,7 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); #ifdef CONFIG_DMA_HELP #include "dma.h" -static int command_dma_help(int argc, char **argv) +static int command_dma_help(int argc, const char **argv) { dma_dump(STM32_DMA2_STREAM0); dma_test(STM32_DMA2_STREAM0); diff --git a/board/osiris/fans.c b/board/osiris/fans.c index 746d4c85c6..523893653d 100644 --- a/board/osiris/fans.c +++ b/board/osiris/fans.c @@ -196,7 +196,7 @@ int fan_percent_to_rpm(int fan, int pct) } #ifdef BOARD_FAN_TEST -static int command_fan_test(int argc, char **argv) +static int command_fan_test(int argc, const char **argv) { char *e; int t; diff --git a/board/panqueque/board.c b/board/panqueque/board.c index c134105b1b..39554e46d8 100644 --- a/board/panqueque/board.c +++ b/board/panqueque/board.c @@ -322,7 +322,7 @@ void board_debug_gpio(enum debug_gpio trigger, int level, int pulse_usec) } } -static int command_dplane(int argc, char **argv) +static int command_dplane(int argc, const char **argv) { char *e; int lane; diff --git a/board/pdeval-stm32f072/usb_pd_policy.c b/board/pdeval-stm32f072/usb_pd_policy.c index 58bc05b990..8cfca952cd 100644 --- a/board/pdeval-stm32f072/usb_pd_policy.c +++ b/board/pdeval-stm32f072/usb_pd_policy.c @@ -108,7 +108,7 @@ void button_event(enum gpio_signal signal) CPRINTS("VBUS %d", vbus_present); } -static int command_vbus_toggle(int argc, char **argv) +static int command_vbus_toggle(int argc, const char **argv) { vbus_present = !vbus_present; CPRINTS("VBUS %d", vbus_present); diff --git a/board/plankton/board.c b/board/plankton/board.c index 165e7dfb80..8a4a0e0da3 100644 --- a/board/plankton/board.c +++ b/board/plankton/board.c @@ -547,7 +547,7 @@ static int sn75dp130_redriver_init(void) return rv; } -static int cmd_usbc_action(int argc, char *argv[]) +static int cmd_usbc_action(int argc, const char *argv[]) { enum usbc_action act; @@ -621,7 +621,7 @@ void board_maybe_reset_usb_hub(void) board_usb_hub_reset(); } -static int cmd_usb_hub_reset(int argc, char *argv[]) +static int cmd_usb_hub_reset(int argc, const char *argv[]) { return board_usb_hub_reset(); } @@ -740,7 +740,7 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); -static int cmd_fake_disconnect(int argc, char *argv[]) +static int cmd_fake_disconnect(int argc, const char *argv[]) { int delay_ms, duration_ms; char *e; @@ -777,7 +777,7 @@ static void trigger_dfu_release(void) } DECLARE_DEFERRED(trigger_dfu_release); -static int cmd_trigger_dfu(int argc, char *argv[]) +static int cmd_trigger_dfu(int argc, const char *argv[]) { gpio_set_level(GPIO_CASE_CLOSE_DFU_L, 0); ccprintf("Asserting CASE_CLOSE_DFU_L.\n"); diff --git a/board/puff/led.c b/board/puff/led.c index ce21bd789a..29367a68dc 100644 --- a/board/puff/led.c +++ b/board/puff/led.c @@ -214,7 +214,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/quiche/board.c b/board/quiche/board.c index 95a69286a7..104600510a 100644 --- a/board/quiche/board.c +++ b/board/quiche/board.c @@ -402,7 +402,7 @@ void board_debug_gpio(enum debug_gpio trigger, int level, int pulse_usec) } } -static int command_dplane(int argc, char **argv) +static int command_dplane(int argc, const char **argv) { char *e; int lane; diff --git a/board/scout/led.c b/board/scout/led.c index 716b95114f..369d339f4f 100644 --- a/board/scout/led.c +++ b/board/scout/led.c @@ -233,7 +233,7 @@ void show_critical_error(void) set_color(EC_LED_ID_POWER_LED, LED_RED, 100); } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/servo_micro/board.c b/board/servo_micro/board.c index 4ea6ec172e..a5b72c3fd5 100644 --- a/board/servo_micro/board.c +++ b/board/servo_micro/board.c @@ -133,7 +133,7 @@ USB_STREAM_CONFIG_USART_IFACE(usart4_usb, USB_IFACE_USART4_STREAM, /****************************************************************************** * Check parity setting on usarts. */ -static int command_uart_parity(int argc, char **argv) +static int command_uart_parity(int argc, const char **argv) { int parity = 0, newparity; struct usart_config const *usart; @@ -173,7 +173,7 @@ DECLARE_CONSOLE_COMMAND(parity, command_uart_parity, "usart[2|3|4] [0|1|2]", /****************************************************************************** * Set baud rate setting on usarts. */ -static int command_uart_baud(int argc, char **argv) +static int command_uart_baud(int argc, const char **argv) { int baud = 0; struct usart_config const *usart; @@ -205,7 +205,7 @@ DECLARE_CONSOLE_COMMAND(baud, command_uart_baud, "usart[2|3|4] rate", /****************************************************************************** * Hold the usart pins low while disabling it, or return it to normal. */ -static int command_hold_usart_low(int argc, char **argv) +static int command_hold_usart_low(int argc, const char **argv) { /* Each bit represents if that port rx is being held low */ static int usart_status; diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c index 48e8ef43e9..097d6e8ab9 100644 --- a/board/servo_v4/usb_pd_policy.c +++ b/board/servo_v4/usb_pd_policy.c @@ -1053,7 +1053,7 @@ static void do_cc(int cc_config_new) } } -static int command_cc(int argc, char **argv) +static int command_cc(int argc, const char **argv) { int cc_config_new = cc_config; @@ -1122,7 +1122,7 @@ static void fake_disconnect_start(void) } DECLARE_DEFERRED(fake_disconnect_start); -static int cmd_fake_disconnect(int argc, char *argv[]) +static int cmd_fake_disconnect(int argc, const char *argv[]) { int delay_ms, duration_ms; char *e; @@ -1152,7 +1152,7 @@ static int cmd_fake_disconnect(int argc, char *argv[]) DECLARE_CONSOLE_COMMAND(fakedisconnect, cmd_fake_disconnect, "<delay_ms> <duration_ms>", NULL); -static int cmd_ada_srccaps(int argc, char *argv[]) +static int cmd_ada_srccaps(int argc, const char *argv[]) { int i; const uint32_t *const ada_srccaps = pd_get_src_caps(CHG); @@ -1173,7 +1173,7 @@ static int cmd_ada_srccaps(int argc, char *argv[]) DECLARE_CONSOLE_COMMAND(ada_srccaps, cmd_ada_srccaps, "", "Print adapter SrcCap"); -static int cmd_dp_action(int argc, char *argv[]) +static int cmd_dp_action(int argc, const char *argv[]) { int i; char *e; @@ -1277,7 +1277,7 @@ static int cmd_dp_action(int argc, char *argv[]) return EC_SUCCESS; } -static int cmd_usbc_action(int argc, char *argv[]) +static int cmd_usbc_action(int argc, const char *argv[]) { if (argc >= 2 && !strcasecmp(argv[1], "dp")) return cmd_dp_action(argc - 1, &argv[1]); diff --git a/board/servo_v4p1/dacs.c b/board/servo_v4p1/dacs.c index 5cf3c0c5de..47eaefa81a 100644 --- a/board/servo_v4p1/dacs.c +++ b/board/servo_v4p1/dacs.c @@ -103,7 +103,7 @@ int write_dac(enum dac_t dac, uint16_t value) } #ifdef SECTION_IS_RO -static int cmd_cc_dac(int argc, char *argv[]) +static int cmd_cc_dac(int argc, const char *argv[]) { uint8_t dac; uint64_t mv; diff --git a/board/servo_v4p1/usb_pd_policy.c b/board/servo_v4p1/usb_pd_policy.c index 81ed23356f..44fcb97829 100644 --- a/board/servo_v4p1/usb_pd_policy.c +++ b/board/servo_v4p1/usb_pd_policy.c @@ -1185,7 +1185,7 @@ static void do_cc(int cc_config_new) } } -static int command_cc(int argc, char **argv) +static int command_cc(int argc, const char **argv) { int cc_config_new = cc_config; @@ -1258,7 +1258,7 @@ static void fake_disconnect_start(void) } DECLARE_DEFERRED(fake_disconnect_start); -static int cmd_fake_disconnect(int argc, char *argv[]) +static int cmd_fake_disconnect(int argc, const char *argv[]) { int delay_ms, duration_ms; char *e; @@ -1288,7 +1288,7 @@ static int cmd_fake_disconnect(int argc, char *argv[]) DECLARE_CONSOLE_COMMAND(fakedisconnect, cmd_fake_disconnect, "<delay_ms> <duration_ms>", NULL); -static int cmd_ada_srccaps(int argc, char *argv[]) +static int cmd_ada_srccaps(int argc, const char *argv[]) { int i; const uint32_t *const ada_srccaps = pd_get_src_caps(CHG); @@ -1310,7 +1310,7 @@ static int cmd_ada_srccaps(int argc, char *argv[]) DECLARE_CONSOLE_COMMAND(ada_srccaps, cmd_ada_srccaps, "", "Print adapter SrcCap"); -static int cmd_dp_action(int argc, char *argv[]) +static int cmd_dp_action(int argc, const char *argv[]) { int i; char *e; @@ -1407,7 +1407,7 @@ static int cmd_dp_action(int argc, char *argv[]) return EC_SUCCESS; } -static int cmd_usbc_action(int argc, char *argv[]) +static int cmd_usbc_action(int argc, const char *argv[]) { if (argc >= 2 && !strcasecmp(argv[1], "dp")) return cmd_dp_action(argc - 1, &argv[1]); diff --git a/board/shotzo/led.c b/board/shotzo/led.c index fda3cd7545..a163831396 100644 --- a/board/shotzo/led.c +++ b/board/shotzo/led.c @@ -281,7 +281,7 @@ int led_set_brightness(enum ec_led_id id, const uint8_t *brightness) return EC_SUCCESS; } -static int command_led(int argc, char **argv) +static int command_led(int argc, const char **argv) { enum ec_led_id id = EC_LED_ID_POWER_LED; diff --git a/board/tigertail/board.c b/board/tigertail/board.c index dd872726db..599653aaf2 100644 --- a/board/tigertail/board.c +++ b/board/tigertail/board.c @@ -311,7 +311,7 @@ void uart_sbu_tick(void) } DECLARE_HOOK(HOOK_TICK, uart_sbu_tick, HOOK_PRIO_DEFAULT); -static int command_uart(int argc, char **argv) +static int command_uart(int argc, const char **argv) { const char *uart_state_str = "off"; const char *uart_detect_str = "manual"; @@ -447,7 +447,7 @@ void button_interrupt(enum gpio_signal signal) hook_call_deferred(&button_interrupt_deferred_data, 0); } -static int command_mux(int argc, char **argv) +static int command_mux(int argc, const char **argv) { char *mux_state_str = "off"; diff --git a/board/twinkie/injector.c b/board/twinkie/injector.c index fc55d0d5ef..dd2d47537c 100644 --- a/board/twinkie/injector.c +++ b/board/twinkie/injector.c @@ -341,9 +341,9 @@ static int fsm_run(int index) /* ------ Console commands ------ */ -static int hex8tou32(char *str, uint32_t *val) +static int hex8tou32(const char *str, uint32_t *val) { - char *ptr = str; + const char *ptr = str; uint32_t tmp = 0; while (*ptr) { @@ -363,7 +363,7 @@ static int hex8tou32(char *str, uint32_t *val) return EC_SUCCESS; } -static int cmd_fsm(int argc, char **argv) +static int cmd_fsm(int argc, const char **argv) { int index; char *e; @@ -380,7 +380,7 @@ static int cmd_fsm(int argc, char **argv) return EC_SUCCESS; } -static int cmd_send(int argc, char **argv) +static int cmd_send(int argc, const char **argv) { int pol, cnt, i; uint16_t header; @@ -409,7 +409,7 @@ static int cmd_send(int argc, char **argv) return EC_SUCCESS; } -static int cmd_cc_level(int argc, char **argv) +static int cmd_cc_level(int argc, const char **argv) { ccprintf("CC1 = %d mV ; CC2 = %d mV\n", pd_adc_read(0, 0), pd_adc_read(0, 1)); @@ -417,7 +417,7 @@ static int cmd_cc_level(int argc, char **argv) return EC_SUCCESS; } -static int cmd_resistor(int argc, char **argv) +static int cmd_resistor(int argc, const char **argv) { int p, r; @@ -439,7 +439,7 @@ static int cmd_resistor(int argc, char **argv) return EC_SUCCESS; } -static int cmd_tx_clock(int argc, char **argv) +static int cmd_tx_clock(int argc, const char **argv) { int freq; char *e; @@ -456,7 +456,7 @@ static int cmd_tx_clock(int argc, char **argv) return EC_SUCCESS; } -static int cmd_rx_threshold(int argc, char **argv) +static int cmd_rx_threshold(int argc, const char **argv) { int mv; char *e; @@ -475,7 +475,7 @@ static int cmd_rx_threshold(int argc, char **argv) return EC_SUCCESS; } -static int cmd_ina_dump(int argc, char **argv, int index) +static int cmd_ina_dump(int argc, const char **argv, int index) { if (index == 1) { /* VCONN INA is off by default, switch it on */ ina2xx_write(index, INA2XX_REG_CONFIG, 0x4123); @@ -495,7 +495,7 @@ static int cmd_ina_dump(int argc, char **argv, int index) return EC_SUCCESS; } -static int cmd_bufwr(int argc, char **argv) +static int cmd_bufwr(int argc, const char **argv) { int idx, cnt, i; char *e; @@ -515,7 +515,7 @@ static int cmd_bufwr(int argc, char **argv) return EC_SUCCESS; } -static int cmd_bufrd(int argc, char **argv) +static int cmd_bufrd(int argc, const char **argv) { int idx, i; int cnt = 1; @@ -541,7 +541,7 @@ static int cmd_bufrd(int argc, char **argv) return EC_SUCCESS; } -static int cmd_sink(int argc, char **argv) +static int cmd_sink(int argc, const char **argv) { /* * Jump to the RW section which should contain a firmware acting @@ -552,7 +552,7 @@ static int cmd_sink(int argc, char **argv) return EC_SUCCESS; } -static int cmd_trace(int argc, char **argv) +static int cmd_trace(int argc, const char **argv) { if (argc < 1) return EC_ERROR_PARAM_COUNT; @@ -569,7 +569,7 @@ static int cmd_trace(int argc, char **argv) return EC_SUCCESS; } -static int command_tw(int argc, char **argv) +static int command_tw(int argc, const char **argv) { if (!strcasecmp(argv[1], "send")) return cmd_send(argc - 2, argv + 2); diff --git a/board/twinkie/sniffer.c b/board/twinkie/sniffer.c index 6b07fc7d1d..574679679e 100644 --- a/board/twinkie/sniffer.c +++ b/board/twinkie/sniffer.c @@ -385,7 +385,7 @@ static void sniffer_sysjump(void) } DECLARE_HOOK(HOOK_SYSJUMP, sniffer_sysjump, HOOK_PRIO_DEFAULT); -static int command_sniffer(int argc, char **argv) +static int command_sniffer(int argc, const char **argv) { ccprintf("Seq number:%d Overflows: %d\n", seq, oflow); diff --git a/chip/ish/power_mgt.c b/chip/ish/power_mgt.c index d6546d9fa4..3f416f2f65 100644 --- a/chip/ish/power_mgt.c +++ b/chip/ish/power_mgt.c @@ -708,7 +708,7 @@ static void print_stats(const char *name, const struct pm_stat *stat) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { struct ish_aon_share *aon_share = pm_ctx.aon_share; diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c index 1040a99af1..2889df7752 100644 --- a/chip/it83xx/clock.c +++ b/chip/it83xx/clock.c @@ -681,7 +681,7 @@ void __ram_code __idle(void) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); diff --git a/chip/it83xx/dac.c b/chip/it83xx/dac.c index bcb7d25024..9057376082 100644 --- a/chip/it83xx/dac.c +++ b/chip/it83xx/dac.c @@ -44,7 +44,7 @@ static void dac_init(void) } DECLARE_HOOK(HOOK_INIT, dac_init, HOOK_PRIO_INIT_DAC); -static int command_dac(int argc, char **argv) +static int command_dac(int argc, const char **argv) { char *e; int ch, mv, rv; diff --git a/chip/it83xx/i2c.c b/chip/it83xx/i2c.c index ba9d5fc034..abc0ed1912 100644 --- a/chip/it83xx/i2c.c +++ b/chip/it83xx/i2c.c @@ -660,7 +660,7 @@ uint32_t i2c_idle_not_allowed(void) return i2c_idle_disabled; } -static int command_i2c_idle_mask(int argc, char **argv) +static int command_i2c_idle_mask(int argc, const char **argv) { ccprintf("i2c idle mask: %08x\n", i2c_idle_disabled); diff --git a/chip/max32660/flash_chip.c b/chip/max32660/flash_chip.c index 29d2f35489..9a17d6bb3e 100644 --- a/chip/max32660/flash_chip.c +++ b/chip/max32660/flash_chip.c @@ -306,7 +306,7 @@ int crec_flash_pre_init(void) * NOTE: This is a DESTRUCTIVE test for the range of flash pages tested * make sure that PAGE_START is beyond your flash code. */ -static int command_flash_test1(int argc, char **argv) +static int command_flash_test1(int argc, const char **argv) { int i; uint8_t *ptr; diff --git a/chip/max32660/hwtimer_chip.c b/chip/max32660/hwtimer_chip.c index a8e21627cd..36a997ca8e 100644 --- a/chip/max32660/hwtimer_chip.c +++ b/chip/max32660/hwtimer_chip.c @@ -220,7 +220,7 @@ int __hw_clock_source_init(uint32_t start_t) return TMR_EVENT_IRQ; } -static int hwtimer_display(int argc, char **argv) +static int hwtimer_display(int argc, const char **argv) { CPRINTS(" TMR_EVENT count 0x%08x", TMR_EVENT->cnt); CPRINTS(" TMR_ROLLOVER count 0x%08x", TMR_ROLLOVER->cnt); diff --git a/chip/max32660/wdt_chip.c b/chip/max32660/wdt_chip.c index 6d25e2b7ea..619fb6d25e 100644 --- a/chip/max32660/wdt_chip.c +++ b/chip/max32660/wdt_chip.c @@ -56,7 +56,7 @@ int watchdog_init(void) return EC_SUCCESS; } -static int command_watchdog_test(int argc, char **argv) +static int command_watchdog_test(int argc, const char **argv) { starve_dog = 1; diff --git a/chip/mchp/clock.c b/chip/mchp/clock.c index 3b3cd2d6af..336c9d1363 100644 --- a/chip/mchp/clock.c +++ b/chip/mchp/clock.c @@ -683,7 +683,7 @@ void __idle(void) * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); @@ -706,7 +706,7 @@ DECLARE_CONSOLE_COMMAND(idlestats, command_idle_stats, "", /** * Configure deep sleep clock settings. */ -static int command_dsleep(int argc, char **argv) +static int command_dsleep(int argc, const char **argv) { int v; diff --git a/chip/mchp/espi.c b/chip/mchp/espi.c index f63262072b..6d98eba913 100644 --- a/chip/mchp/espi.c +++ b/chip/mchp/espi.c @@ -1398,7 +1398,7 @@ void espi_init(void) } #ifdef CONFIG_MCHP_ESPI_EC_CMD -static int command_espi(int argc, char **argv) +static int command_espi(int argc, const char **argv) { uint32_t chan, w0, w1, w2; char *e; diff --git a/chip/mchp/gpio_cmds.c b/chip/mchp/gpio_cmds.c index abbe366367..49756d89a8 100644 --- a/chip/mchp/gpio_cmds.c +++ b/chip/mchp/gpio_cmds.c @@ -19,7 +19,7 @@ #define CPUTS(outstr) cputs(CC_LPC, outstr) #define CPRINTS(format, args...) cprints(CC_LPC, format, ##args) -static int cmd_gp_get_config(int argc, char **argv) +static int cmd_gp_get_config(int argc, const char **argv) { char *e; int i; @@ -57,7 +57,7 @@ static int cmd_gp_get_config(int argc, char **argv) DECLARE_CONSOLE_COMMAND(gpgetcfg, cmd_gp_get_config, "[number]", "Read GPIO config"); -static int cmd_gp_set_config(int argc, char **argv) +static int cmd_gp_set_config(int argc, const char **argv) { char *e; int i; diff --git a/chip/mchp/lpc.c b/chip/mchp/lpc.c index e44c40a7bd..a6536bd7f4 100644 --- a/chip/mchp/lpc.c +++ b/chip/mchp/lpc.c @@ -941,7 +941,7 @@ void lpc_disable_acpi_interrupts(void) } /* On boards without a host, this command is used to set up LPC */ -static int lpc_command_init(int argc, char **argv) +static int lpc_command_init(int argc, const char **argv) { lpc_init(); return EC_SUCCESS; @@ -969,7 +969,7 @@ DECLARE_HOST_COMMAND(EC_CMD_GET_PROTOCOL_INFO, lpc_get_protocol_info, EC_VER_MASK(0)); #ifdef CONFIG_MCHP_DEBUG_LPC -static int command_lpc(int argc, char **argv) +static int command_lpc(int argc, const char **argv) { if (argc == 1) return EC_ERROR_PARAM1; diff --git a/chip/mec1322/clock.c b/chip/mec1322/clock.c index f541af53cc..bb5a295f63 100644 --- a/chip/mec1322/clock.c +++ b/chip/mec1322/clock.c @@ -410,7 +410,7 @@ void __idle(void) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); @@ -429,7 +429,7 @@ DECLARE_CONSOLE_COMMAND(idlestats, command_idle_stats, "", /** * Configure deep sleep clock settings. */ -static int command_dsleep(int argc, char **argv) +static int command_dsleep(int argc, const char **argv) { int v; diff --git a/chip/mt_scp/mt818x/clock_mt8183.c b/chip/mt_scp/mt818x/clock_mt8183.c index 6eda9e38ff..3dba83bd31 100644 --- a/chip/mt_scp/mt818x/clock_mt8183.c +++ b/chip/mt_scp/mt818x/clock_mt8183.c @@ -353,7 +353,7 @@ static void clock_fast_wakeup_irq(void) } /* Console command */ -static int command_ulposc(int argc, char *argv[]) +static int command_ulposc(int argc, const char *argv[]) { if (argc > 1 && !strncmp(argv[1], "cal", 3)) { scp_calibrate_ulposc(0, ULPOSC1_CLOCK_MHZ); diff --git a/chip/mt_scp/mt818x/clock_mt8186.c b/chip/mt_scp/mt818x/clock_mt8186.c index d7c7563b91..7dcf9d42b0 100644 --- a/chip/mt_scp/mt818x/clock_mt8186.c +++ b/chip/mt_scp/mt818x/clock_mt8186.c @@ -365,7 +365,7 @@ void clock_fast_wakeup_irq(void) } /* Console command */ -static int command_ulposc(int argc, char *argv[]) +static int command_ulposc(int argc, const char *argv[]) { int i; diff --git a/chip/mt_scp/mt818x/memmap.c b/chip/mt_scp/mt818x/memmap.c index 8df36dae0d..a6bcca6452 100644 --- a/chip/mt_scp/mt818x/memmap.c +++ b/chip/mt_scp/mt818x/memmap.c @@ -189,7 +189,7 @@ static void scp_cache_init(void) cpu_invalidate_dcache(); } -static int command_cacheinfo(int argc, char **argv) +static int command_cacheinfo(int argc, const char **argv) { const char cache_name[] = { 'I', 'D' }; int c; diff --git a/chip/mt_scp/mt8192/clock.c b/chip/mt_scp/mt8192/clock.c index b1901bfe1a..26e4f84f74 100644 --- a/chip/mt_scp/mt8192/clock.c +++ b/chip/mt_scp/mt8192/clock.c @@ -368,7 +368,7 @@ void clock_init(void) } #ifdef DEBUG -int command_ulposc(int argc, char *argv[]) +int command_ulposc(int argc, const char *argv[]) { int i; diff --git a/chip/mt_scp/mt8195/clock.c b/chip/mt_scp/mt8195/clock.c index 7a97a437cc..5c0e651a1d 100644 --- a/chip/mt_scp/mt8195/clock.c +++ b/chip/mt_scp/mt8195/clock.c @@ -488,7 +488,7 @@ void clock_init(void) } #ifdef DEBUG -int command_ulposc(int argc, char *argv[]) +int command_ulposc(int argc, const char *argv[]) { uint32_t osc; diff --git a/chip/mt_scp/rv32i_common/cache.c b/chip/mt_scp/rv32i_common/cache.c index f2f20dbd36..fe2081ae8b 100644 --- a/chip/mt_scp/rv32i_common/cache.c +++ b/chip/mt_scp/rv32i_common/cache.c @@ -59,7 +59,7 @@ void cache_init(void) */ static enum { PMU_SELECT_I = 0, PMU_SELECT_D, PMU_SELECT_C } pmu_select; -int command_enable_pmu(int argc, char **argv) +int command_enable_pmu(int argc, const char **argv) { static const char *const selectors[] = { [PMU_SELECT_I] = "I", @@ -142,7 +142,7 @@ int command_enable_pmu(int argc, char **argv) DECLARE_SAFE_CONSOLE_COMMAND(enable_pmu, command_enable_pmu, "[I | D | C]", "Enable PMU"); -int command_disable_pmu(int argc, char **argv) +int command_disable_pmu(int argc, const char **argv) { clear_csr(CSR_PMU_MPMUCTR, CSR_PMU_MPMUCTR_C | CSR_PMU_MPMUCTR_I | CSR_PMU_MPMUCTR_H3 | @@ -152,7 +152,7 @@ int command_disable_pmu(int argc, char **argv) DECLARE_SAFE_CONSOLE_COMMAND(disable_pmu, command_disable_pmu, NULL, "Disable PMU"); -int command_show_pmu(int argc, char **argv) +int command_show_pmu(int argc, const char **argv) { uint64_t val3, val4, val5; uint32_t p; diff --git a/chip/mt_scp/rv32i_common/cache.h b/chip/mt_scp/rv32i_common/cache.h index 2bb95e64de..7c7cfec237 100644 --- a/chip/mt_scp/rv32i_common/cache.h +++ b/chip/mt_scp/rv32i_common/cache.h @@ -132,9 +132,9 @@ struct mpu_entry { void cache_init(void); #ifdef DEBUG -int command_enable_pmu(int argc, char **argv); -int command_disable_pmu(int argc, char **argv); -int command_show_pmu(int argc, char **argv); +int command_enable_pmu(int argc, const char **argv); +int command_disable_pmu(int argc, const char **argv); +int command_show_pmu(int argc, const char **argv); #endif #endif /* #ifndef __CROS_EC_CACHE_H */ diff --git a/chip/npcx/clock.c b/chip/npcx/clock.c index 2525815359..f119a620e2 100644 --- a/chip/npcx/clock.c +++ b/chip/npcx/clock.c @@ -450,7 +450,7 @@ void __idle(void) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); @@ -467,7 +467,7 @@ DECLARE_CONSOLE_COMMAND(idlestats, command_idle_stats, "", /** * Configure deep sleep clock settings. */ -static int command_dsleep(int argc, char **argv) +static int command_dsleep(int argc, const char **argv) { int v; diff --git a/chip/npcx/espi.c b/chip/npcx/espi.c index 6479e85c62..dfd3befa5b 100644 --- a/chip/npcx/espi.c +++ b/chip/npcx/espi.c @@ -678,7 +678,7 @@ void espi_init(void) espi_enable_vw_int(&espi_vw_int_list[i]); } -static int command_espi(int argc, char **argv) +static int command_espi(int argc, const char **argv) { uint32_t chan; char *e; diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c index 9fa39d4176..0f7e034a84 100644 --- a/chip/npcx/flash.c +++ b/chip/npcx/flash.c @@ -787,7 +787,7 @@ static int flash_spi_sel_lock(int enable) /*****************************************************************************/ /* Console commands */ -static int command_flash_spi_sel_lock(int argc, char **argv) +static int command_flash_spi_sel_lock(int argc, const char **argv) { int ena; @@ -802,7 +802,7 @@ static int command_flash_spi_sel_lock(int argc, char **argv) DECLARE_CONSOLE_COMMAND(flash_spi_lock, command_flash_spi_sel_lock, "[on | off]", "Lock spi flash interface selection"); -static int command_flash_tristate(int argc, char **argv) +static int command_flash_tristate(int argc, const char **argv) { int ena; @@ -819,7 +819,7 @@ DECLARE_CONSOLE_COMMAND(flash_tristate, command_flash_tristate, "[on | off]", "Tristate spi flash pins"); #endif /* CONFIG_CMD_FLASH_TRISTATE */ -static int command_flash_chip(int argc, char **argv) +static int command_flash_chip(int argc, const char **argv) { uint8_t jedec_id[3]; uint8_t sr1, sr2; diff --git a/chip/npcx/gpio.c b/chip/npcx/gpio.c index cae7b13fd2..db90583359 100644 --- a/chip/npcx/gpio.c +++ b/chip/npcx/gpio.c @@ -670,7 +670,7 @@ void gpio_interrupt(struct npcx_wui wui_int) * Command used to disable input buffer of gpios one by one to * investigate power consumption */ -static int command_gpiodisable(int argc, char **argv) +static int command_gpiodisable(int argc, const char **argv) { uint8_t i; uint8_t offset; diff --git a/chip/npcx/lct.c b/chip/npcx/lct.c index 0770b5e9e2..15610f40ef 100644 --- a/chip/npcx/lct.c +++ b/chip/npcx/lct.c @@ -143,7 +143,7 @@ static void npcx_lct_init(void) DECLARE_HOOK(HOOK_INIT, npcx_lct_init, HOOK_PRIO_DEFAULT); #ifdef CONFIG_CMD_RTC_ALARM -static int command_lctalarm(int argc, char **argv) +static int command_lctalarm(int argc, const char **argv) { char *e; int seconds; diff --git a/chip/npcx/lpc.c b/chip/npcx/lpc.c index 28126a22d2..1227b4c53f 100644 --- a/chip/npcx/lpc.c +++ b/chip/npcx/lpc.c @@ -973,7 +973,7 @@ DECLARE_HOST_COMMAND(EC_CMD_GET_PROTOCOL_INFO, lpc_get_protocol_info, EC_VER_MASK(0)); #if DEBUG_LPC -static int command_lpc(int argc, char **argv) +static int command_lpc(int argc, const char **argv) { if (argc == 1) return EC_ERROR_PARAM1; diff --git a/chip/npcx/peci.c b/chip/npcx/peci.c index 7b198a81f9..cdcab6c5b9 100644 --- a/chip/npcx/peci.c +++ b/chip/npcx/peci.c @@ -276,7 +276,7 @@ DECLARE_IRQ(NPCX_IRQ_PECI, peci_done_interrupt, 4); /*****************************************************************************/ /* Console commands */ -static int command_peci_temp(int argc, char **argv) +static int command_peci_temp(int argc, const char **argv) { int t = peci_get_cpu_temp(); if (t == -1) { diff --git a/chip/npcx/ps2.c b/chip/npcx/ps2.c index 02c1190980..f0c47c84a1 100644 --- a/chip/npcx/ps2.c +++ b/chip/npcx/ps2.c @@ -316,7 +316,7 @@ static void ps2_int_handler(void) DECLARE_IRQ(NPCX_IRQ_PS2, ps2_int_handler, 5); #ifdef CONFIG_CMD_PS2 -static int command_ps2ench(int argc, char **argv) +static int command_ps2ench(int argc, const char **argv) { uint8_t ch; uint8_t enable; @@ -339,7 +339,7 @@ static int command_ps2ench(int argc, char **argv) DECLARE_CONSOLE_COMMAND(ps2ench, command_ps2ench, "ps2_ench channel 1|0", "Enable/Disable PS/2 channel"); -static int command_ps2write(int argc, char **argv) +static int command_ps2write(int argc, const char **argv) { uint8_t ch, data; char *e; diff --git a/chip/npcx/spi.c b/chip/npcx/spi.c index 03c394d1f6..b7cb3b7a8c 100644 --- a/chip/npcx/spi.c +++ b/chip/npcx/spi.c @@ -233,7 +233,7 @@ static int printrx(const char *desc, const uint8_t *txdata, int txlen, return EC_SUCCESS; } -static int command_spirom(int argc, char **argv) +static int command_spirom(int argc, const char **argv) { uint8_t txmandev[] = { 0x90, 0x00, 0x00, 0x00 }; uint8_t txjedec[] = { 0x9f }; diff --git a/chip/npcx/system.c b/chip/npcx/system.c index c10ce9a01d..59dd21341a 100644 --- a/chip/npcx/system.c +++ b/chip/npcx/system.c @@ -1207,7 +1207,7 @@ void print_system_rtc(enum console_channel ch) } #ifdef CONFIG_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; @@ -1231,7 +1231,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/chip/npcx/wov.c b/chip/npcx/wov.c index 5796078c8f..fe493e9163 100644 --- a/chip/npcx/wov.c +++ b/chip/npcx/wov.c @@ -1815,7 +1815,7 @@ void wov_handle_event(enum wov_events event) static uint32_t voice_buffer[VOICE_BUF_SIZE] = { 0 }; /* voice data 16Khz 2ch 16bit 1s */ -static int command_wov(int argc, char **argv) +static int command_wov(int argc, const char **argv) { static int bit_clk; static enum wov_dai_format i2s_fmt; diff --git a/chip/stm32/clock-f.c b/chip/stm32/clock-f.c index 953c793245..ada86f5ec8 100644 --- a/chip/stm32/clock-f.c +++ b/chip/stm32/clock-f.c @@ -397,7 +397,7 @@ void print_system_rtc(enum console_channel ch) } #ifdef CONFIG_CMD_RTC -static int command_system_rtc(int argc, char **argv) +static int command_system_rtc(int argc, const char **argv) { char *e; uint32_t t; @@ -418,7 +418,7 @@ DECLARE_CONSOLE_COMMAND(rtc, command_system_rtc, "[set <seconds>]", "Get/set real-time clock"); #ifdef CONFIG_CMD_RTC_ALARM -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; struct rtc_time_reg rtc; diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c index 9896696227..20dada354e 100644 --- a/chip/stm32/clock-stm32f0.c +++ b/chip/stm32/clock-stm32f0.c @@ -481,7 +481,7 @@ void rtc_set(uint32_t sec) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); diff --git a/chip/stm32/clock-stm32f3.c b/chip/stm32/clock-stm32f3.c index 5a57e289fa..953176b158 100644 --- a/chip/stm32/clock-stm32f3.c +++ b/chip/stm32/clock-stm32f3.c @@ -481,7 +481,7 @@ void rtc_set(uint32_t sec) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); diff --git a/chip/stm32/clock-stm32f4.c b/chip/stm32/clock-stm32f4.c index 1ea7b83ad0..d6930da815 100644 --- a/chip/stm32/clock-stm32f4.c +++ b/chip/stm32/clock-stm32f4.c @@ -584,7 +584,7 @@ void __idle(void) } /* Print low power idle statistics. */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); diff --git a/chip/stm32/clock-stm32h7.c b/chip/stm32/clock-stm32h7.c index 09cf24e3a3..7812f5d2f9 100644 --- a/chip/stm32/clock-stm32h7.c +++ b/chip/stm32/clock-stm32h7.c @@ -590,7 +590,7 @@ void __idle(void) /** * Print low power idle statistics */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); @@ -657,7 +657,7 @@ void clock_init(void) #endif } -static int command_clock(int argc, char **argv) +static int command_clock(int argc, const char **argv) { if (argc >= 2) { if (!strcasecmp(argv[1], "hsi")) diff --git a/chip/stm32/clock-stm32l.c b/chip/stm32/clock-stm32l.c index 8edd6167ef..20b3730a99 100644 --- a/chip/stm32/clock-stm32l.c +++ b/chip/stm32/clock-stm32l.c @@ -364,7 +364,7 @@ static void clock_chipset_shutdown(void) DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, clock_chipset_shutdown, HOOK_PRIO_DEFAULT); DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, clock_chipset_shutdown, HOOK_PRIO_DEFAULT); -static int command_clock(int argc, char **argv) +static int command_clock(int argc, const char **argv) { if (argc >= 2) { if (!strcasecmp(argv[1], "hsi")) diff --git a/chip/stm32/clock-stm32l4.c b/chip/stm32/clock-stm32l4.c index 034e0c7dea..b078ab472d 100644 --- a/chip/stm32/clock-stm32l4.c +++ b/chip/stm32/clock-stm32l4.c @@ -621,7 +621,7 @@ static void clock_chipset_shutdown(void) DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, clock_chipset_shutdown, HOOK_PRIO_DEFAULT); DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, clock_chipset_shutdown, HOOK_PRIO_DEFAULT); -static int command_clock(int argc, char **argv) +static int command_clock(int argc, const char **argv) { if (argc >= 2) { if (!strcasecmp(argv[1], "hsi")) @@ -1104,7 +1104,7 @@ void __idle(void) /*****************************************************************************/ /* Console commands */ /* Print low power idle statistics. */ -static int command_idle_stats(int argc, char **argv) +static int command_idle_stats(int argc, const char **argv) { timestamp_t ts = get_time(); diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c index c5eff18684..4b4637deb8 100644 --- a/chip/stm32/i2c-stm32l.c +++ b/chip/stm32/i2c-stm32l.c @@ -409,7 +409,7 @@ void i2c_init(void) /*****************************************************************************/ /* Console commands */ -static int command_i2cdump(int argc, char **argv) +static int command_i2cdump(int argc, const char **argv) { dump_i2c_reg(I2C_PORT_MASTER, "dump"); return EC_SUCCESS; diff --git a/chip/stm32/i2c_ite_flash_support.c b/chip/stm32/i2c_ite_flash_support.c index 590748776c..fb916a64c2 100644 --- a/chip/stm32/i2c_ite_flash_support.c +++ b/chip/stm32/i2c_ite_flash_support.c @@ -225,7 +225,7 @@ unlock: } /* Enable ITE direct firmware update (DFU) mode. */ -static int command_enable_ite_dfu(int argc, char **argv) +static int command_enable_ite_dfu(int argc, const char **argv) { if (argc > 1) return EC_ERROR_PARAM_COUNT; @@ -338,7 +338,7 @@ DECLARE_CONSOLE_COMMAND(enable_ite_dfu, command_enable_ite_dfu, "", "Enable ITE Direct Firmware Update (DFU) mode"); /* Read ITE chip ID. Can be used to verify ITE DFU mode. */ -static int command_get_ite_chipid(int argc, char **argv) +static int command_get_ite_chipid(int argc, const char **argv) { if (argc > 1) return EC_ERROR_PARAM_COUNT; diff --git a/chip/stm32/power_led.c b/chip/stm32/power_led.c index d30e742ca1..f2f38f21db 100644 --- a/chip/stm32/power_led.c +++ b/chip/stm32/power_led.c @@ -139,7 +139,7 @@ void power_led_task(void) #define CONFIG_CMD_POWERLED #ifdef CONFIG_CMD_POWERLED -static int command_powerled(int argc, char **argv) +static int command_powerled(int argc, const char **argv) { enum powerled_state state; diff --git a/chip/stm32/trng.c b/chip/stm32/trng.c index a975c4c584..90e6651cb4 100644 --- a/chip/stm32/trng.c +++ b/chip/stm32/trng.c @@ -104,7 +104,7 @@ test_mockable void trng_exit(void) * update RO once in production. */ #if defined(SECTION_IS_RW) -static int command_rand(int argc, char **argv) +static int command_rand(int argc, const char **argv) { uint8_t data[32]; char str_buf[hex_str_buf_size(sizeof(data))]; diff --git a/chip/stm32/ucpd-stm32gx.c b/chip/stm32/ucpd-stm32gx.c index 7783721067..a00f6172a0 100644 --- a/chip/stm32/ucpd-stm32gx.c +++ b/chip/stm32/ucpd-stm32gx.c @@ -1490,7 +1490,7 @@ void ucpd_info(int port) ucpd_task_log_dump(); } -static int command_ucpd(int argc, char **argv) +static int command_ucpd(int argc, const char **argv) { uint32_t tx_data = 0; char *e; diff --git a/chip/stm32/usart_info_command.c b/chip/stm32/usart_info_command.c index 3f36603eda..8098a27463 100644 --- a/chip/stm32/usart_info_command.c +++ b/chip/stm32/usart_info_command.c @@ -9,7 +9,7 @@ #include "console.h" #include "usart.h" -static int command_usart_info(int argc, char **argv) +static int command_usart_info(int argc, const char **argv) { struct usart_configs configs = usart_get_configs(); size_t i; diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c index 37f34aac13..297f2a3a74 100644 --- a/chip/stm32/usb.c +++ b/chip/stm32/usb.c @@ -921,7 +921,7 @@ static int usb_save_serial(const char *serialno) return rv; } -static int command_serialno(int argc, char **argv) +static int command_serialno(int argc, const char **argv) { struct usb_string_desc *sd = usb_serialno_desc; char buf[CONFIG_SERIALNO_LEN]; @@ -975,7 +975,7 @@ static int usb_save_mac_addr(const char *mac_addr) } } -static int command_macaddr(int argc, char **argv) +static int command_macaddr(int argc, const char **argv) { const char *buf; int rv = EC_SUCCESS; diff --git a/chip/stm32/usb_dwc.c b/chip/stm32/usb_dwc.c index 7201cb8406..1b8550a50b 100644 --- a/chip/stm32/usb_dwc.c +++ b/chip/stm32/usb_dwc.c @@ -1302,7 +1302,7 @@ static void usb_info(void) } } -static int command_usb(int argc, char **argv) +static int command_usb(int argc, const char **argv) { if (argc > 1) { if (!strcasecmp("on", argv[1])) @@ -1378,7 +1378,7 @@ static int usb_save_serial(const char *serialno) return rv; } -static int command_serialno(int argc, char **argv) +static int command_serialno(int argc, const char **argv) { struct usb_string_desc *sd = usb_serialno_desc; char buf[CONFIG_SERIALNO_LEN]; diff --git a/common/adc.c b/common/adc.c index b83a3fb98a..c244a9f380 100644 --- a/common/adc.c +++ b/common/adc.c @@ -41,7 +41,7 @@ static int print_one_adc(int channel) return EC_SUCCESS; } -static int command_adc(int argc, char **argv) +static int command_adc(int argc, const char **argv) { int i, ret; diff --git a/common/als.c b/common/als.c index b4d5ae1e5e..bc2050d61f 100644 --- a/common/als.c +++ b/common/als.c @@ -101,7 +101,7 @@ DECLARE_HOOK(HOOK_INIT, als_task_init, HOOK_PRIO_ALS_INIT); /* Console commands */ #ifdef CONFIG_CMD_ALS -static int command_als(int argc, char **argv) +static int command_als(int argc, const char **argv) { int i, rv, val; diff --git a/common/ap_hang_detect.c b/common/ap_hang_detect.c index ed80ca7632..7687296f4f 100644 --- a/common/ap_hang_detect.c +++ b/common/ap_hang_detect.c @@ -208,7 +208,7 @@ DECLARE_HOST_COMMAND(EC_CMD_HANG_DETECT, hang_detect_host_command, /*****************************************************************************/ /* Console command */ -static int command_hang_detect(int argc, char **argv) +static int command_hang_detect(int argc, const char **argv) { ccprintf("flags: 0x%x\n", hdparams.flags); diff --git a/common/base_state.c b/common/base_state.c index 6d0704e0ba..91a4e6d0ec 100644 --- a/common/base_state.c +++ b/common/base_state.c @@ -33,7 +33,7 @@ void base_set_state(int state) } #endif -static int command_setbasestate(int argc, char **argv) +static int command_setbasestate(int argc, const char **argv) { if (argc != 2) return EC_ERROR_PARAM_COUNT; diff --git a/common/battery.c b/common/battery.c index 9023af7c0e..dbbe648360 100644 --- a/common/battery.c +++ b/common/battery.c @@ -263,7 +263,7 @@ void print_battery_debug(void) print_battery_info(); } -static int command_battery(int argc, char **argv) +static int command_battery(int argc, const char **argv) { int repeat = 1; int loop; @@ -374,7 +374,7 @@ static void check_pending_cutoff(void) } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, check_pending_cutoff, HOOK_PRIO_LAST); -static int command_cutoff(int argc, char **argv) +static int command_cutoff(int argc, const char **argv) { int rv; @@ -438,7 +438,7 @@ __overridable int battery_set_vendor_param(uint32_t param, uint32_t value) return EC_ERROR_UNIMPLEMENTED; } -static int console_command_battery_vendor_param(int argc, char **argv) +static int console_command_battery_vendor_param(int argc, const char **argv) { uint32_t param; uint32_t value; diff --git a/common/btle_hci_controller.c b/common/btle_hci_controller.c index 72ffe26d63..7df66d4a82 100644 --- a/common/btle_hci_controller.c +++ b/common/btle_hci_controller.c @@ -431,7 +431,7 @@ static uint8_t hci_buf[200]; #define MAX_BLE_HCI_PARAMS 8 static uint32_t param[MAX_BLE_HCI_PARAMS]; -static int command_ble_hci_cmd(int argc, char **argv) +static int command_ble_hci_cmd(int argc, const char **argv) { static struct hciCmdHdr header; int length, opcode, i; @@ -475,7 +475,7 @@ DECLARE_CONSOLE_COMMAND(ble_hci_cmd, command_ble_hci_cmd, "opcode len uint32 uint32 uint32... (little endian)", "Send an hci command of length len"); -static int command_hcitool(int argc, char **argv) +static int command_hcitool(int argc, const char **argv) { static struct hciCmdHdr header; int i, ogf, ocf; @@ -516,7 +516,7 @@ DECLARE_CONSOLE_COMMAND( "cmd ogf ocf b0 b1 b2 b3... or lcmd opcode len uint32.. (little endian)", "Send an hci command of length len"); -static int command_ble_hci_acl(int argc, char **argv) +static int command_ble_hci_acl(int argc, const char **argv) { static struct hciAclHdr header; int length, hdr, i; @@ -560,7 +560,7 @@ DECLARE_CONSOLE_COMMAND(ble_hci_acl, command_ble_hci_acl, "hdr len uint32 uint32 uint32... (little endian)", "Send hci acl data of length len"); -static int command_ble_hci_adv(int argc, char **argv) +static int command_ble_hci_adv(int argc, const char **argv) { static struct hciCmdHdr header; int adv, p = 0, scan_rsp = 0; diff --git a/common/button.c b/common/button.c index 1020ed4672..79d51bce99 100644 --- a/common/button.c +++ b/common/button.c @@ -422,7 +422,7 @@ static void simulate_button(uint32_t button_mask, int press_ms) #endif /* #ifdef CONFIG_SIMULATED_BUTTON */ #ifdef CONFIG_CMD_BUTTON -static int console_command_button(int argc, char **argv) +static int console_command_button(int argc, const char **argv) { int press_ms = 50; char *e; diff --git a/common/cbi.c b/common/cbi.c index f878e4492e..a3cb3c210f 100644 --- a/common/cbi.c +++ b/common/cbi.c @@ -456,7 +456,7 @@ static void dump_cbi(void) static uint8_t buf[sizeof(struct ec_params_set_cbi) + CONFIG_CONSOLE_INPUT_LINE_SIZE]; -static int cc_cbi(int argc, char **argv) +static int cc_cbi(int argc, const char **argv) { struct __ec_align4 ec_params_set_cbi *setter = (struct __ec_align4 ec_params_set_cbi *)buf; diff --git a/common/charge_manager.c b/common/charge_manager.c index 70e0e1540f..7da64395fe 100644 --- a/common/charge_manager.c +++ b/common/charge_manager.c @@ -400,7 +400,7 @@ int charge_manager_get_vbus_voltage(int port) } #ifdef CONFIG_CMD_VBUS -static int command_vbus(int argc, char **argv) +static int command_vbus(int argc, const char **argv) { /* port = -1 to print all the ports */ int port = -1; @@ -1554,7 +1554,7 @@ DECLARE_HOST_COMMAND(EC_CMD_OVERRIDE_DEDICATED_CHARGER_LIMIT, hc_override_dedicated_charger_limit, EC_VER_MASK(0)); #endif -static int command_charge_port_override(int argc, char **argv) +static int command_charge_port_override(int argc, const char **argv) { int port = OVERRIDE_OFF; int ret = EC_SUCCESS; @@ -1617,7 +1617,7 @@ hc_external_power_limit(struct host_cmd_handler_args *args) DECLARE_HOST_COMMAND(EC_CMD_EXTERNAL_POWER_LIMIT, hc_external_power_limit, EC_VER_MASK(1)); -static int command_external_power_limit(int argc, char **argv) +static int command_external_power_limit(int argc, const char **argv) { int max_current; int max_voltage; @@ -1648,7 +1648,7 @@ DECLARE_CONSOLE_COMMAND(chglim, command_external_power_limit, #endif /* CONFIG_CHARGE_MANAGER_EXTERNAL_POWER_LIMIT */ #ifdef CONFIG_CMD_CHARGE_SUPPLIER_INFO -static int charge_supplier_info(int argc, char **argv) +static int charge_supplier_info(int argc, const char **argv) { int p, s; int port_printed; diff --git a/common/charge_ramp_sw.c b/common/charge_ramp_sw.c index 7a84343205..3d2aa88b76 100644 --- a/common/charge_ramp_sw.c +++ b/common/charge_ramp_sw.c @@ -356,7 +356,7 @@ void chg_ramp_task(void *u) } #ifdef CONFIG_CMD_CHGRAMP -static int command_chgramp(int argc, char **argv) +static int command_chgramp(int argc, const char **argv) { int i; int port; diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 6cd2858457..ec18930dcd 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -2694,7 +2694,7 @@ DECLARE_HOST_COMMAND(EC_CMD_CHARGE_STATE, charge_command_charge_state, #ifdef CONFIG_CMD_PWR_AVG -static int command_pwr_avg(int argc, char **argv) +static int command_pwr_avg(int argc, const char **argv) { int avg_mv; int avg_ma; @@ -2718,7 +2718,7 @@ DECLARE_CONSOLE_COMMAND(pwr_avg, command_pwr_avg, NULL, #endif /* CONFIG_CMD_PWR_AVG */ -static int command_chgstate(int argc, char **argv) +static int command_chgstate(int argc, const char **argv) { int rv; int val; @@ -2776,7 +2776,7 @@ DECLARE_CONSOLE_COMMAND(chgstate, command_chgstate, "Get/set charge state machine status"); #ifdef CONFIG_EC_EC_COMM_BATTERY_CLIENT -static int command_chgdualdebug(int argc, char **argv) +static int command_chgdualdebug(int argc, const char **argv) { int val; char *e; diff --git a/common/chargen.c b/common/chargen.c index 824017b91b..19f90cfe69 100644 --- a/common/chargen.c +++ b/common/chargen.c @@ -37,7 +37,7 @@ * * Hitting 'x' on the keyboard stops the generator. */ -static int command_chargen(int argc, char **argv) +static int command_chargen(int argc, const char **argv) { int wrap_value = 0; int wrap_counter = 0; diff --git a/common/charger.c b/common/charger.c index 307e04dd8c..5936b50591 100644 --- a/common/charger.c +++ b/common/charger.c @@ -184,7 +184,7 @@ void print_charger_debug(int chgnum) ccputs("disabled\n"); } -static int command_charger(int argc, char **argv) +static int command_charger(int argc, const char **argv) { int d; char *e; diff --git a/common/charger_profile_override.c b/common/charger_profile_override.c index 62b7c19321..604da16b6f 100644 --- a/common/charger_profile_override.c +++ b/common/charger_profile_override.c @@ -134,7 +134,7 @@ enum ec_status charger_profile_override_set_param(uint32_t param, } #ifdef CONFIG_CMD_CHARGER_PROFILE_OVERRIDE -static int command_fastcharge(int argc, char **argv) +static int command_fastcharge(int argc, const char **argv) { if (argc > 1 && !parse_bool(argv[1], &fast_charging_allowed)) return EC_ERROR_PARAM1; @@ -152,7 +152,7 @@ DECLARE_CONSOLE_COMMAND(fastcharge, command_fastcharge, "[on|off]", * fast charging profile is selected. */ #ifdef CONFIG_CMD_CHARGER_PROFILE_OVERRIDE_TEST -static int command_fastcharge_test(int argc, char **argv) +static int command_fastcharge_test(int argc, const char **argv) { char *e; int test_on; diff --git a/common/chargesplash.c b/common/chargesplash.c index 88bc6a63f1..bc99f9a68f 100644 --- a/common/chargesplash.c +++ b/common/chargesplash.c @@ -171,7 +171,7 @@ static void handle_chipset_shutdown(void) } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, handle_chipset_shutdown, HOOK_PRIO_DEFAULT); -static int command_chargesplash(int argc, char **argv) +static int command_chargesplash(int argc, const char **argv) { if (argc != 2) { return EC_ERROR_PARAM_COUNT; diff --git a/common/chipset.c b/common/chipset.c index a640afcdd7..d4f5517238 100644 --- a/common/chipset.c +++ b/common/chipset.c @@ -24,7 +24,7 @@ /* Console commands */ #ifdef CONFIG_CMD_POWER_AP -static int command_apreset(int argc, char **argv) +static int command_apreset(int argc, const char **argv) { /* Force the chipset to reset */ ccprintf("Issuing AP reset...\n"); @@ -33,7 +33,7 @@ static int command_apreset(int argc, char **argv) } DECLARE_CONSOLE_COMMAND(apreset, command_apreset, NULL, "Issue AP reset"); -static int command_apshutdown(int argc, char **argv) +static int command_apshutdown(int argc, const char **argv) { chipset_force_shutdown(CHIPSET_SHUTDOWN_CONSOLE_CMD); return EC_SUCCESS; diff --git a/common/console.c b/common/console.c index 53cb5e77fc..efb37f467d 100644 --- a/common/console.c +++ b/common/console.c @@ -85,7 +85,7 @@ enum extended_key_code { * @return EC_SUCCESS. If more than MAX_ARGS_PER_COMMAND words are found, * discards the excess and returns EC_ERROR_OVERFLOW. */ -static int split_words(char *input, int *argc, char **argv) +static int split_words(char *input, int *argc, const char **argv) { char *c; int in_word = 0; @@ -129,7 +129,7 @@ static int split_words(char *input, int *argc, char **argv) * * @return A pointer to the command structure, or NULL if no match found. */ -static const struct console_command *find_command(char *name) +static const struct console_command *find_command(const char *name) { const struct console_command *cmd, *match = NULL; int match_length = strlen(name); @@ -167,7 +167,7 @@ static const char *const errmsgs[] = { static int handle_command(char *input) { const struct console_command *cmd; - char *argv[MAX_ARGS_PER_COMMAND]; + const char *argv[MAX_ARGS_PER_COMMAND]; int argc = 0; int rv; #ifdef CONFIG_EXPERIMENTAL_CONSOLE @@ -691,7 +691,7 @@ void console_task(void *u) /* Console commands */ /* Command handler - prints help. */ -static int command_help(int argc, char **argv) +static int command_help(int argc, const char **argv) { const int ncmds = __cmds_end - __cmds; const int cols = 5; /* printing in five columns */ @@ -765,7 +765,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(help, command_help, "[ list | <name> ]", "Print command help"); #ifdef CONFIG_CONSOLE_HISTORY -static int command_history(int argc, char **argv) +static int command_history(int argc, const char **argv) { int i; diff --git a/common/console_output.c b/common/console_output.c index 0471559838..ed79525ae8 100644 --- a/common/console_output.c +++ b/common/console_output.c @@ -151,7 +151,7 @@ void cflush(void) #ifdef CONFIG_CONSOLE_CHANNEL /* Set active channels */ -static int command_ch(int argc, char **argv) +static int command_ch(int argc, const char **argv) { int i; char *e; diff --git a/common/device_event.c b/common/device_event.c index 3b9a76c8e0..154801243f 100644 --- a/common/device_event.c +++ b/common/device_event.c @@ -87,7 +87,7 @@ void device_enable_event(enum ec_device_event event) /* Console commands */ #ifdef CONFIG_CMD_DEVICE_EVENT -static int command_device_event(int argc, char **argv) +static int command_device_event(int argc, const char **argv) { /* Handle sub-commands */ if (argc == 3) { diff --git a/common/device_state.c b/common/device_state.c index c19f5abb7f..16d0fb4f86 100644 --- a/common/device_state.c +++ b/common/device_state.c @@ -66,7 +66,7 @@ static void check_device_state(void) } DECLARE_HOOK(HOOK_SECOND, check_device_state, HOOK_PRIO_DEFAULT); -static int command_devices(int argc, char **argv) +static int command_devices(int argc, const char **argv) { const struct device_config *dc = device_states; int i; diff --git a/common/dps.c b/common/dps.c index e984c9e725..96a3eb30d9 100644 --- a/common/dps.c +++ b/common/dps.c @@ -547,7 +547,7 @@ void dps_task(void *u) } } -static int command_dps(int argc, char **argv) +static int command_dps(int argc, const char **argv) { int port = charge_manager_get_active_charge_port(); int input_pwr, vbus, input_curr; diff --git a/common/dptf.c b/common/dptf.c index f43dd68c68..13191c8e2c 100644 --- a/common/dptf.c +++ b/common/dptf.c @@ -174,7 +174,7 @@ DECLARE_HOOK(HOOK_SECOND, thermal_control_dptf, HOOK_PRIO_TEMP_SENSOR_DONE); /*****************************************************************************/ /* Console commands */ -static int command_dptftemp(int argc, char **argv) +static int command_dptftemp(int argc, const char **argv) { int id, t; int temp, trig; diff --git a/common/ec_features.c b/common/ec_features.c index 34e0c35c7c..5028b5b012 100644 --- a/common/ec_features.c +++ b/common/ec_features.c @@ -168,7 +168,7 @@ __overridable uint32_t board_override_feature_flags1(uint32_t flags1) return flags1; } -static int cc_feat(int argc, char **argv) +static int cc_feat(int argc, const char **argv) { ccprintf(" 0-31: 0x%08x\n", get_feature_flags0()); ccprintf("32-63: 0x%08x\n", get_feature_flags1()); diff --git a/common/event_log.c b/common/event_log.c index cdf9f4dd90..cc7bcdbec7 100644 --- a/common/event_log.c +++ b/common/event_log.c @@ -134,7 +134,7 @@ retry: /* * Display TPM event logs. */ -static int command_dlog(int argc, char **argv) +static int command_dlog(int argc, const char **argv) { size_t log_cur; const uint8_t *const log_events_end = diff --git a/common/fan.c b/common/fan.c index 98dda066f8..6454204098 100644 --- a/common/fan.c +++ b/common/fan.c @@ -136,7 +136,7 @@ static void set_duty_cycle(int fan, int percent) /*****************************************************************************/ /* Console commands */ -static int cc_fanauto(int argc, char **argv) +static int cc_fanauto(int argc, const char **argv) { char *e; int fan = 0; @@ -174,7 +174,7 @@ static int is_powered(int fan) return is_pgood; } -static int cc_faninfo(int argc, char **argv) +static int cc_faninfo(int argc, const char **argv) { static const char *const human_status[] = { "not spinning", "changing", "locked", "frustrated" }; @@ -211,7 +211,7 @@ static int cc_faninfo(int argc, char **argv) } DECLARE_CONSOLE_COMMAND(faninfo, cc_faninfo, NULL, "Print fan info"); -static int cc_fanset(int argc, char **argv) +static int cc_fanset(int argc, const char **argv) { const char *rpm_str; int rpm; @@ -271,7 +271,7 @@ static int cc_fanset(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fanset, cc_fanset, "[fan] (rpm | pct%)", "Set fan speed"); -static int cc_fanduty(int argc, char **argv) +static int cc_fanduty(int argc, const char **argv) { const char *percent_str; int percent = 0; diff --git a/common/flash.c b/common/flash.c index 6e3ee8f2b5..d32bbb6614 100644 --- a/common/flash.c +++ b/common/flash.c @@ -978,7 +978,7 @@ DECLARE_DEFERRED(flash_erase_deferred); /* Console commands */ #ifdef CONFIG_CMD_FLASHINFO -static int command_flash_info(int argc, char **argv) +static int command_flash_info(int argc, const char **argv) { int i, flags; @@ -1049,7 +1049,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(flashinfo, command_flash_info, NULL, #endif /* CONFIG_CMD_FLASHINFO */ #ifdef CONFIG_CMD_FLASH -static int command_flash_erase(int argc, char **argv) +static int command_flash_erase(int argc, const char **argv) { int offset = -1; int size = -1; @@ -1068,7 +1068,7 @@ static int command_flash_erase(int argc, char **argv) DECLARE_CONSOLE_COMMAND(flasherase, command_flash_erase, "offset size", "Erase flash"); -static int command_flash_write(int argc, char **argv) +static int command_flash_write(int argc, const char **argv) { int offset = -1; int size = -1; @@ -1108,7 +1108,7 @@ static int command_flash_write(int argc, char **argv) DECLARE_CONSOLE_COMMAND(flashwrite, command_flash_write, "offset size", "Write pattern to flash"); -static int command_flash_read(int argc, char **argv) +static int command_flash_read(int argc, const char **argv) { int offset = -1; int size = 256; @@ -1157,7 +1157,7 @@ DECLARE_CONSOLE_COMMAND(flashread, command_flash_read, "offset [size]", #endif #ifdef CONFIG_CMD_FLASH_WP -static int command_flash_wp(int argc, char **argv) +static int command_flash_wp(int argc, const char **argv) { int val; diff --git a/common/fpsensor/fpsensor.c b/common/fpsensor/fpsensor.c index 101dd06a35..4ff77b6577 100644 --- a/common/fpsensor/fpsensor.c +++ b/common/fpsensor/fpsensor.c @@ -761,7 +761,7 @@ static enum ec_error_list fp_console_action(uint32_t mode) return EC_ERROR_TIMEOUT; } -static int command_fpcapture(int argc, char **argv) +static int command_fpcapture(int argc, const char **argv) { int capture_type = FP_CAPTURE_SIMPLE_IMAGE; uint32_t mode; @@ -794,7 +794,7 @@ DECLARE_CONSOLE_COMMAND_FLAGS(fpcapture, command_fpcapture, NULL, "Capture fingerprint in PGM format", CMD_FLAG_RESTRICTED); -static int command_fpenroll(int argc, char **argv) +static int command_fpenroll(int argc, const char **argv) { enum ec_error_list rc; int percent = 0; @@ -834,7 +834,7 @@ static int command_fpenroll(int argc, char **argv) DECLARE_CONSOLE_COMMAND_FLAGS(fpenroll, command_fpenroll, NULL, "Enroll a new fingerprint", CMD_FLAG_RESTRICTED); -static int command_fpmatch(int argc, char **argv) +static int command_fpmatch(int argc, const char **argv) { enum ec_error_list rc = fp_console_action(FP_MODE_MATCH); uint32_t event = atomic_clear(&fp_events); @@ -852,7 +852,7 @@ static int command_fpmatch(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fpmatch, command_fpmatch, NULL, "Run match algorithm against finger"); -static int command_fpclear(int argc, char **argv) +static int command_fpclear(int argc, const char **argv) { /* * We intentionally run this on the fp_task so that we use the @@ -870,7 +870,7 @@ static int command_fpclear(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fpclear, command_fpclear, NULL, "Clear fingerprint sensor context"); -static int command_fpmaintenance(int argc, char **argv) +static int command_fpmaintenance(int argc, const char **argv) { #ifdef HAVE_FP_PRIVATE_DRIVER return fp_maintenance(); diff --git a/common/gesture.c b/common/gesture.c index 215159d061..0ade256336 100644 --- a/common/gesture.c +++ b/common/gesture.c @@ -304,7 +304,7 @@ void gesture_calc(uint32_t *event) /*****************************************************************************/ /* Console commands */ -static int command_tap_info(int argc, char **argv) +static int command_tap_info(int argc, const char **argv) { int val; diff --git a/common/gpio_commands.c b/common/gpio_commands.c index eb80720f48..9524235773 100644 --- a/common/gpio_commands.c +++ b/common/gpio_commands.c @@ -127,7 +127,7 @@ static void print_gpio_info(int gpio) cflush(); } -static int command_gpio_get(int argc, char **argv) +static int command_gpio_get(int argc, const char **argv) { int i; @@ -154,7 +154,7 @@ static int command_gpio_get(int argc, char **argv) DECLARE_SAFE_CONSOLE_COMMAND(gpioget, command_gpio_get, "[name]", "Read GPIO value(s)"); -static int command_gpio_set(int argc, char **argv) +static int command_gpio_set(int argc, const char **argv) { #ifdef CONFIG_CMD_GPIO_EXTENDED int gpio; diff --git a/common/hooks.c b/common/hooks.c index d5e45a5324..33f377d134 100644 --- a/common/hooks.c +++ b/common/hooks.c @@ -265,7 +265,7 @@ static void print_hook_delay(uint32_t interval, uint32_t delay, uint32_t avg) ccprintf(" Average: %7d us (%d%%)\n\n", avg, percent_avg); } -static int command_stats(int argc, char **argv) +static int command_stats(int argc, const char **argv) { int i; 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; diff --git a/common/host_command_controller.c b/common/host_command_controller.c index 4df5b6e449..51f72e6aef 100644 --- a/common/host_command_controller.c +++ b/common/host_command_controller.c @@ -183,7 +183,7 @@ int pd_host_command(int command, int version, const void *outdata, int outsize, return rv; } -static int command_pd_mcu(int argc, char **argv) +static int command_pd_mcu(int argc, const char **argv) { char *e; static char outbuf[128]; diff --git a/common/host_event_commands.c b/common/host_event_commands.c index dee249ba4c..a29435066a 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -459,7 +459,7 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, clear_events_copy_b, HOOK_PRIO_DEFAULT); /*****************************************************************************/ /* Console commands */ -static int command_host_event(int argc, char **argv) +static int command_host_event(int argc, const char **argv) { /* Handle sub-commands */ if (argc == 3) { diff --git a/common/i2c_controller.c b/common/i2c_controller.c index ee72caa1ef..6b7f218fda 100644 --- a/common/i2c_controller.c +++ b/common/i2c_controller.c @@ -1521,7 +1521,7 @@ DECLARE_HOST_COMMAND(EC_CMD_I2C_CONTROL, i2c_command_control, EC_VER_MASK(0)); /* Console commands */ #ifdef CONFIG_CMD_I2C_PROTECT -static int command_i2cprotect(int argc, char **argv) +static int command_i2cprotect(int argc, const char **argv) { if (argc == 1) { int i, port; @@ -1597,7 +1597,7 @@ scan_bus_exit: ccputs("\n"); } -static int command_scan(int argc, char **argv) +static int command_scan(int argc, const char **argv) { int port; char *e; @@ -1632,7 +1632,7 @@ DECLARE_CONSOLE_COMMAND(i2cscan, command_scan, "i2cscan [port]", #endif #ifdef CONFIG_CMD_I2C_XFER -static int command_i2cxfer(int argc, char **argv) +static int command_i2cxfer(int argc, const char **argv) { int port; uint16_t addr_flags; @@ -1801,7 +1801,7 @@ static const char *const i2c_freq_str[] = { BUILD_ASSERT(ARRAY_SIZE(i2c_freq_str) == I2C_FREQ_COUNT + 1); -static int command_i2c_speed(int argc, char **argv) +static int command_i2c_speed(int argc, const char **argv) { int port; char *e; @@ -1880,7 +1880,7 @@ static void i2c_test_status(struct i2c_test_results *i2c_test, int test_dev) } #define I2C_STRESS_TEST_DATA_VERIFY_RETRY_COUNT 3 -static int command_i2ctest(int argc, char **argv) +static int command_i2ctest(int argc, const char **argv) { char *e; int i, j, rv; diff --git a/common/i2c_trace.c b/common/i2c_trace.c index b39f0f5266..1351639c20 100644 --- a/common/i2c_trace.c +++ b/common/i2c_trace.c @@ -153,7 +153,7 @@ static int command_i2ctrace_enable(int port, int addr_lo, int addr_hi) return EC_ERROR_MEMORY_ALLOCATION; } -static int command_i2ctrace(int argc, char **argv) +static int command_i2ctrace(int argc, const char **argv) { int id_or_port; int address_low; diff --git a/common/i2c_wedge.c b/common/i2c_wedge.c index 9caa880052..6e5e66a939 100644 --- a/common/i2c_wedge.c +++ b/common/i2c_wedge.c @@ -246,7 +246,7 @@ static void i2c_bang_wedge_read(int addr, int reg, int bit_count, int reboot) #define WEDGE_READ 2 #define WEDGE_REBOOT 4 -static int command_i2c_wedge(int argc, char **argv) +static int command_i2c_wedge(int argc, const char **argv) { int addr, reg, wedge_flag = 0, wedge_bit_count = -1; char *e; @@ -327,7 +327,7 @@ DECLARE_CONSOLE_COMMAND(i2cwedge, command_i2c_wedge, "[wedge_flag [wedge_bit_count]]", "Wedge host I2C bus"); -static int command_i2c_unwedge(int argc, char **argv) +static int command_i2c_unwedge(int argc, const char **argv) { i2c_unwedge(I2C_PORT_HOST); diff --git a/common/ioexpander_commands.c b/common/ioexpander_commands.c index 8b12a6fa9f..c8b1cb0262 100644 --- a/common/ioexpander_commands.c +++ b/common/ioexpander_commands.c @@ -100,7 +100,7 @@ static enum ec_error_list ioex_set(const char *name, int value) return ioex_set_level(signal, value); } -static int command_ioex_set(int argc, char **argv) +static int command_ioex_set(int argc, const char **argv) { char *e; int v; @@ -120,7 +120,7 @@ static int command_ioex_set(int argc, char **argv) DECLARE_CONSOLE_COMMAND(ioexset, command_ioex_set, "name <0 | 1>", "Set level of a IO expander pin"); -static int command_ioex_get(int argc, char **argv) +static int command_ioex_get(int argc, const char **argv) { enum ioex_signal signal; diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c index bf1d3f3c2e..013c230094 100644 --- a/common/keyboard_8042.c +++ b/common/keyboard_8042.c @@ -1049,7 +1049,7 @@ test_mockable void keyboard_update_button(enum keyboard_button_type button, /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_KEYBOARD -static int command_typematic(int argc, char **argv) +static int command_typematic(int argc, const char **argv) { int i; @@ -1071,7 +1071,7 @@ static int command_typematic(int argc, char **argv) return EC_SUCCESS; } -static int command_codeset(int argc, char **argv) +static int command_codeset(int argc, const char **argv) { if (argc == 2) { int set = strtoi(argv[1], NULL, 0); @@ -1090,7 +1090,7 @@ static int command_codeset(int argc, char **argv) return EC_SUCCESS; } -static int command_controller_ram(int argc, char **argv) +static int command_controller_ram(int argc, const char **argv) { int index; @@ -1108,7 +1108,7 @@ static int command_controller_ram(int argc, char **argv) return EC_SUCCESS; } -static int command_keyboard_log(int argc, char **argv) +static int command_keyboard_log(int argc, const char **argv) { int i; @@ -1151,7 +1151,7 @@ static int command_keyboard_log(int argc, char **argv) return EC_SUCCESS; } -static int command_keyboard(int argc, char **argv) +static int command_keyboard(int argc, const char **argv) { int ena; @@ -1166,7 +1166,7 @@ static int command_keyboard(int argc, char **argv) return EC_SUCCESS; } -static int command_8042_internal(int argc, char **argv) +static int command_8042_internal(int argc, const char **argv) { int i; @@ -1223,7 +1223,7 @@ DECLARE_CONSOLE_COMMAND(kbd, command_keyboard, "[on | off]", "Print or toggle keyboard info"); #endif -static int command_8042(int argc, char **argv) +static int command_8042(int argc, const char **argv) { if (argc >= 2) { if (!strcasecmp(argv[1], "internal")) @@ -1241,7 +1241,7 @@ static int command_8042(int argc, char **argv) else return EC_ERROR_PARAM1; } else { - char *ctlram_argv[] = { "ctrlram", "0" }; + const char *ctlram_argv[] = { "ctrlram", "0" }; ccprintf("\n- Typematic:\n"); command_typematic(argc, argv); diff --git a/common/keyboard_backlight.c b/common/keyboard_backlight.c index 9e4ae97c14..80ff4d3132 100644 --- a/common/keyboard_backlight.c +++ b/common/keyboard_backlight.c @@ -153,7 +153,7 @@ DECLARE_HOOK(HOOK_LID_CHANGE, kblight_lid_change, HOOK_PRIO_DEFAULT); /* * Console and host commands */ -static int cc_kblight(int argc, char **argv) +static int cc_kblight(int argc, const char **argv) { if (argc >= 2) { char *e; diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c index 117f590d67..b57782ecc7 100644 --- a/common/keyboard_scan.c +++ b/common/keyboard_scan.c @@ -1171,7 +1171,7 @@ int keyboard_get_keyboard_id(void) /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_KEYBOARD -static int command_ksstate(int argc, char **argv) +static int command_ksstate(int argc, const char **argv) { if (argc > 1) { if (!strcasecmp(argv[1], "force")) { @@ -1193,7 +1193,7 @@ static int command_ksstate(int argc, char **argv) DECLARE_CONSOLE_COMMAND(ksstate, command_ksstate, "ksstate [on | off | force]", "Show or toggle printing keyboard scan state"); -static int command_keyboard_press(int argc, char **argv) +static int command_keyboard_press(int argc, const char **argv) { if (argc == 1) { int i, j; diff --git a/common/led_pwm.c b/common/led_pwm.c index e8f6c2bdf3..203d3f83f5 100644 --- a/common/led_pwm.c +++ b/common/led_pwm.c @@ -265,7 +265,7 @@ DECLARE_HOOK(HOOK_TICK, update_leds, HOOK_PRIO_DEFAULT); #endif /* CONFIG_LED_PWM_TASK_DISABLED */ #ifdef CONFIG_CMD_LEDTEST -static int command_ledtest(int argc, char **argv) +static int command_ledtest(int argc, const char **argv) { int enable; int pwm_led_id; diff --git a/common/lid_switch.c b/common/lid_switch.c index dd82544b2f..c566a38fc7 100644 --- a/common/lid_switch.c +++ b/common/lid_switch.c @@ -133,21 +133,21 @@ void enable_lid_detect(bool enable) } } -static int command_lidopen(int argc, char **argv) +static int command_lidopen(int argc, const char **argv) { lid_switch_open(); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(lidopen, command_lidopen, NULL, "Simulate lid open"); -static int command_lidclose(int argc, char **argv) +static int command_lidclose(int argc, const char **argv) { lid_switch_close(); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(lidclose, command_lidclose, NULL, "Simulate lid close"); -static int command_lidstate(int argc, char **argv) +static int command_lidstate(int argc, const char **argv) { ccprintf("lid state: %s\n", debounced_lid_open ? "open" : "closed"); diff --git a/common/lightbar.c b/common/lightbar.c index 8a2e1f32d9..b3fe6dc032 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -1887,7 +1887,7 @@ static void show_msg_names(void) lightbar_cmds[st.cur_seq].string); } -static int command_lightbar(int argc, char **argv) +static int command_lightbar(int argc, const char **argv) { int i; uint8_t num, led, r = 0, g = 0, b = 0; diff --git a/common/memory_commands.c b/common/memory_commands.c index 506b385626..2dd181df04 100644 --- a/common/memory_commands.c +++ b/common/memory_commands.c @@ -55,7 +55,7 @@ static void show_val(uint32_t address, uint32_t index, enum format fmt) cflush(); } -static int command_mem_dump(int argc, char **argv) +static int command_mem_dump(int argc, const char **argv) { uint32_t address, i, num = 1; char *e; @@ -112,7 +112,7 @@ DECLARE_CONSOLE_COMMAND_FLAGS( #endif /* CONFIG_CMD_MD */ #ifdef CONFIG_CMD_RW -static int command_read_word(int argc, char **argv) +static int command_read_word(int argc, const char **argv) { volatile uint32_t *address; uint32_t value; diff --git a/common/mkbp_event.c b/common/mkbp_event.c index b499789e04..40c4f5f8bb 100644 --- a/common/mkbp_event.c +++ b/common/mkbp_event.c @@ -541,7 +541,7 @@ static enum ec_status hc_mkbp_wake_mask(struct host_cmd_handler_args *args) } DECLARE_HOST_COMMAND(EC_CMD_MKBP_WAKE_MASK, hc_mkbp_wake_mask, EC_VER_MASK(0)); -static int command_mkbp_wake_mask(int argc, char **argv) +static int command_mkbp_wake_mask(int argc, const char **argv) { if (argc == 3) { char *e; diff --git a/common/mkbp_input_devices.c b/common/mkbp_input_devices.c index 1a51ac107d..d5dcbd9dc6 100644 --- a/common/mkbp_input_devices.c +++ b/common/mkbp_input_devices.c @@ -195,7 +195,7 @@ static void simulate_key(int row, int col, int pressed) mkbp_fifo_add((uint8_t)EC_MKBP_EVENT_KEY_MATRIX, simulated_key); } -static int command_mkbp_keyboard_press(int argc, char **argv) +static int command_mkbp_keyboard_press(int argc, const char **argv) { if (argc == 1) { int i, j; diff --git a/common/motion_sense.c b/common/motion_sense.c index 80e9c24473..a28f23a72b 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -1572,7 +1572,7 @@ DECLARE_HOST_COMMAND(EC_CMD_MOTION_SENSE_CMD, host_cmd_motion_sense, /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_ACCELS -static int command_accelrange(int argc, char **argv) +static int command_accelrange(int argc, const char **argv) { char *e; int id, data, round = 1; @@ -1617,7 +1617,7 @@ static int command_accelrange(int argc, char **argv) DECLARE_CONSOLE_COMMAND(accelrange, command_accelrange, "id [data [roundup]]", "Read or write accelerometer range"); -static int command_accelresolution(int argc, char **argv) +static int command_accelresolution(int argc, const char **argv) { char *e; int id, data, round = 1; @@ -1665,7 +1665,7 @@ DECLARE_CONSOLE_COMMAND(accelres, command_accelresolution, "id [data [roundup]]", "Read or write accelerometer resolution"); -static int command_accel_data_rate(int argc, char **argv) +static int command_accel_data_rate(int argc, const char **argv) { char *e; int id, data, round = 1; @@ -1722,7 +1722,7 @@ DECLARE_CONSOLE_COMMAND(accelrate, command_accel_data_rate, "id [data [roundup]]", "Read or write accelerometer ODR"); -static int command_accel_read_xyz(int argc, char **argv) +static int command_accel_read_xyz(int argc, const char **argv) { char *e; int id, n = 1, ret; @@ -1760,7 +1760,7 @@ static int command_accel_read_xyz(int argc, char **argv) DECLARE_CONSOLE_COMMAND(accelread, command_accel_read_xyz, "id [n]", "Read sensor x/y/z"); -static int command_accel_init(int argc, char **argv) +static int command_accel_init(int argc, const char **argv) { char *e; int id, ret; @@ -1784,7 +1784,7 @@ static int command_accel_init(int argc, char **argv) DECLARE_CONSOLE_COMMAND(accelinit, command_accel_init, "id", "Init sensor"); #ifdef CONFIG_CMD_ACCEL_INFO -static int command_display_accel_info(int argc, char **argv) +static int command_display_accel_info(int argc, const char **argv) { int val, i, j; @@ -1844,7 +1844,7 @@ static void print_spoof_mode_status(int id) } #ifdef CONFIG_CMD_ACCELSPOOF -static int command_accelspoof(int argc, char **argv) +static int command_accelspoof(int argc, const char **argv) { char *e; int id, enable, i; diff --git a/common/ocpc.c b/common/ocpc.c index 11958a33f0..55b88eeedc 100644 --- a/common/ocpc.c +++ b/common/ocpc.c @@ -698,7 +698,7 @@ void ocpc_init(struct ocpc_data *ocpc) board_ocpc_init(ocpc); } -static int command_ocpcdebug(int argc, char **argv) +static int command_ocpcdebug(int argc, const char **argv) { if (argc < 2) return EC_ERROR_PARAM_COUNT; @@ -728,7 +728,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(ocpcdebug, command_ocpcdebug, "Each segment is 5% of current target. All shows" " both. Disable shows no debug output."); -static int command_ocpcpid(int argc, char **argv) +static int command_ocpcpid(int argc, const char **argv) { int *num, *denom; diff --git a/common/panic_output.c b/common/panic_output.c index ffbe1525da..14c66204fc 100644 --- a/common/panic_output.c +++ b/common/panic_output.c @@ -334,7 +334,7 @@ static void stack_overflow_recurse(int n) /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_CRASH -static int command_crash(int argc, char **argv) +static int command_crash(int argc, const char **argv) { if (argc < 2) return EC_ERROR_PARAM1; @@ -386,7 +386,7 @@ DECLARE_CONSOLE_COMMAND(crash, command_crash, "Crash the system (for testing)"); #endif /* CONFIG_CMD_CRASH */ -static int command_panicinfo(int argc, char **argv) +static int command_panicinfo(int argc, const char **argv) { struct panic_data *const pdata_ptr = panic_get_data(); diff --git a/common/peci.c b/common/peci.c index 5acc49dfd2..333f35fa6d 100644 --- a/common/peci.c +++ b/common/peci.c @@ -73,7 +73,7 @@ int peci_temp_sensor_get_val(int idx, int *temp_ptr) /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_PECI -static int peci_cmd(int argc, char **argv) +static int peci_cmd(int argc, const char **argv) { uint8_t r_buf[PECI_READ_DATA_FIFO_SIZE] = { 0 }; uint8_t w_buf[PECI_WRITE_DATA_FIFO_SIZE] = { 0 }; @@ -153,7 +153,7 @@ static int peci_cmd(int argc, char **argv) DECLARE_CONSOLE_COMMAND(peci, peci_cmd, "addr wlen rlen cmd timeout(us)", "PECI command"); -static int command_peci_temp(int argc, char **argv) +static int command_peci_temp(int argc, const char **argv) { int t; diff --git a/common/peripheral_charger.c b/common/peripheral_charger.c index 657c634e3a..a61ab668af 100644 --- a/common/peripheral_charger.c +++ b/common/peripheral_charger.c @@ -744,7 +744,7 @@ static enum ec_status hc_pchg_update(struct host_cmd_handler_args *args) } DECLARE_HOST_COMMAND(EC_CMD_PCHG_UPDATE, hc_pchg_update, EC_VER_MASK(0)); -static int cc_pchg(int argc, char **argv) +static int cc_pchg(int argc, const char **argv) { int port; char *end; diff --git a/common/port80.c b/common/port80.c index 72195c5793..15819f4925 100644 --- a/common/port80.c +++ b/common/port80.c @@ -135,7 +135,7 @@ static void port80_dump_buffer(void) /*****************************************************************************/ /* Console commands */ -static int command_port80(int argc, char **argv) +static int command_port80(int argc, const char **argv) { /* * 'port80 scroll' toggles whether port 80 output begins with a newline diff --git a/common/power_button.c b/common/power_button.c index aec4571cd7..6aaa293631 100644 --- a/common/power_button.c +++ b/common/power_button.c @@ -219,7 +219,7 @@ void power_button_simulate_press(int duration) /*****************************************************************************/ /* Console commands */ -static int command_powerbtn(int argc, char **argv) +static int command_powerbtn(int argc, const char **argv) { int ms = 200; /* Press duration in ms */ char *e; diff --git a/common/pwm.c b/common/pwm.c index df869673b8..c571851aae 100644 --- a/common/pwm.c +++ b/common/pwm.c @@ -109,13 +109,13 @@ static void print_channel(enum pwm_channel ch, int max_duty) ccprintf(" %d: disabled\n", ch); } -static int cc_pwm_duty(int argc, char **argv) +static int cc_pwm_duty(int argc, const char **argv) { int value = 0; int max_duty = 100; int ch; char *e; - char *raw; + const char *raw; if (argc < 2) { ccprintf("PWM channels:\n"); diff --git a/common/rgb_keyboard.c b/common/rgb_keyboard.c index 5d92da688c..092d5f0d3d 100644 --- a/common/rgb_keyboard.c +++ b/common/rgb_keyboard.c @@ -579,7 +579,7 @@ static int int_to_rgb(const char *code, struct rgb_s *rgb) return EC_SUCCESS; } -test_export_static int cc_rgb(int argc, char **argv) +test_export_static int cc_rgb(int argc, const char **argv) { char *end, *comma; struct rgb_s rgb, scale; diff --git a/common/rollback.c b/common/rollback.c index 8f4e8f86e7..518d48a2e0 100644 --- a/common/rollback.c +++ b/common/rollback.c @@ -350,7 +350,7 @@ int rollback_add_entropy(const uint8_t *data, unsigned int len) return rollback_update(-1, data, len); } -static int command_rollback_update(int argc, char **argv) +static int command_rollback_update(int argc, const char **argv) { int32_t min_version; char *e; @@ -369,7 +369,7 @@ DECLARE_CONSOLE_COMMAND(rollbackupdate, command_rollback_update, "min_version", "Update rollback info"); #ifdef CONFIG_ROLLBACK_SECRET_SIZE -static int command_rollback_add_entropy(int argc, char **argv) +static int command_rollback_add_entropy(int argc, const char **argv) { int len; @@ -443,7 +443,7 @@ DECLARE_HOST_COMMAND(EC_CMD_ADD_ENTROPY, hc_rollback_add_entropy, #endif /* CONFIG_ROLLBACK_SECRET_SIZE */ #endif /* CONFIG_ROLLBACK_UPDATE */ -static int command_rollback_info(int argc, char **argv) +static int command_rollback_info(int argc, const char **argv) { int ret = EC_ERROR_UNKNOWN; int region, min_region; diff --git a/common/shared_mem.c b/common/shared_mem.c index e1d87fdf84..5c8555a7bb 100644 --- a/common/shared_mem.c +++ b/common/shared_mem.c @@ -62,7 +62,7 @@ void shared_mem_release(void *ptr) } #ifdef CONFIG_CMD_SHMEM -static int command_shmem(int argc, char **argv) +static int command_shmem(int argc, const char **argv) { ccprintf("Size:%6d\n", shared_mem_size()); ccprintf("Used:%6d\n", buf_in_use); diff --git a/common/shmalloc.c b/common/shmalloc.c index 251948f1dd..a977d522de 100644 --- a/common/shmalloc.c +++ b/common/shmalloc.c @@ -349,7 +349,7 @@ void shared_mem_release(void *ptr) #ifdef CONFIG_CMD_SHMEM -static int command_shmem(int argc, char **argv) +static int command_shmem(int argc, const char **argv) { size_t allocated_size; size_t free_size; diff --git a/common/spi_commands.c b/common/spi_commands.c index b51609d257..f30795c0d5 100644 --- a/common/spi_commands.c +++ b/common/spi_commands.c @@ -13,7 +13,7 @@ #include "timer.h" #include "util.h" -static int command_spixfer(int argc, char **argv) +static int command_spixfer(int argc, const char **argv) { int dev_id; uint8_t offset; diff --git a/common/spi_flash.c b/common/spi_flash.c index a77e8a8337..878a3291d5 100644 --- a/common/spi_flash.c +++ b/common/spi_flash.c @@ -479,7 +479,7 @@ int spi_flash_set_protect(unsigned int offset, unsigned int bytes) return spi_flash_set_status(sr1, sr2); } -static int command_spi_flashinfo(int argc, char **argv) +static int command_spi_flashinfo(int argc, const char **argv) { uint8_t jedec[3]; uint8_t unique[8]; @@ -527,7 +527,7 @@ DECLARE_HOST_COMMAND(EC_CMD_FLASH_SPI_INFO, flash_command_spi_info, #endif /* CONFIG_HOSTCMD_FLASH_SPI_INFO */ #ifdef CONFIG_CMD_SPI_FLASH -static int command_spi_flasherase(int argc, char **argv) +static int command_spi_flasherase(int argc, const char **argv) { int offset = -1; int bytes = 4096; @@ -548,7 +548,7 @@ static int command_spi_flasherase(int argc, char **argv) DECLARE_CONSOLE_COMMAND(spi_flasherase, command_spi_flasherase, "offset [bytes]", "Erase flash"); -static int command_spi_flashwrite(int argc, char **argv) +static int command_spi_flashwrite(int argc, const char **argv) { int offset = -1; int bytes = SPI_FLASH_MAX_WRITE_SIZE; @@ -593,7 +593,7 @@ static int command_spi_flashwrite(int argc, char **argv) DECLARE_CONSOLE_COMMAND(spi_flashwrite, command_spi_flashwrite, "offset [bytes]", "Write pattern to flash"); -static int command_spi_flashread(int argc, char **argv) +static int command_spi_flashread(int argc, const char **argv) { int i; int offset = -1; @@ -650,7 +650,7 @@ static int command_spi_flashread(int argc, char **argv) DECLARE_CONSOLE_COMMAND(spi_flashread, command_spi_flashread, "offset bytes", "Read flash"); -static int command_spi_flashread_sr(int argc, char **argv) +static int command_spi_flashread_sr(int argc, const char **argv) { spi_enable(SPI_FLASH_DEVICE, 1); @@ -662,7 +662,7 @@ static int command_spi_flashread_sr(int argc, char **argv) DECLARE_CONSOLE_COMMAND(spi_flash_rsr, command_spi_flashread_sr, NULL, "Read status registers"); -static int command_spi_flashwrite_sr(int argc, char **argv) +static int command_spi_flashwrite_sr(int argc, const char **argv) { int val1 = 0; int val2 = 0; @@ -680,7 +680,7 @@ static int command_spi_flashwrite_sr(int argc, char **argv) DECLARE_CONSOLE_COMMAND(spi_flash_wsr, command_spi_flashwrite_sr, "value1 value2", "Write to status registers"); -static int command_spi_flashprotect(int argc, char **argv) +static int command_spi_flashprotect(int argc, const char **argv) { int val1 = 0; int val2 = 0; diff --git a/common/spi_nor.c b/common/spi_nor.c index e8ef49d061..e8a5417c32 100644 --- a/common/spi_nor.c +++ b/common/spi_nor.c @@ -866,7 +866,7 @@ err_free: /* Serial NOR Flash console commands. */ #ifdef CONFIG_CMD_SPI_NOR -static int command_spi_nor_info(int argc, char **argv) +static int command_spi_nor_info(int argc, const char **argv) { int rv = EC_SUCCESS; @@ -934,7 +934,7 @@ DECLARE_CONSOLE_COMMAND(spinorinfo, command_spi_nor_info, "[device]", #endif /* CONFIG_CMD_SPI_NOR */ #ifdef CONFIG_CMD_SPI_NOR -static int command_spi_nor_erase(int argc, char **argv) +static int command_spi_nor_erase(int argc, const char **argv) { const struct spi_nor_device_t *spi_nor_device; int spi_nor_device_index; @@ -963,7 +963,7 @@ DECLARE_CONSOLE_COMMAND(spinorerase, command_spi_nor_erase, #endif /* CONFIG_CMD_SPI_NOR */ #ifdef CONFIG_CMD_SPI_NOR -static int command_spi_nor_write(int argc, char **argv) +static int command_spi_nor_write(int argc, const char **argv) { const struct spi_nor_device_t *spi_nor_device; int spi_nor_device_index; @@ -1013,7 +1013,7 @@ DECLARE_CONSOLE_COMMAND(spinorwrite, command_spi_nor_write, #endif /* CONFIG_CMD_SPI_NOR */ #ifdef CONFIG_CMD_SPI_NOR -static int command_spi_nor_read(int argc, char **argv) +static int command_spi_nor_read(int argc, const char **argv) { const struct spi_nor_device_t *spi_nor_device; int spi_nor_device_index; diff --git a/common/switch.c b/common/switch.c index 8581614d16..bf0701091d 100644 --- a/common/switch.c +++ b/common/switch.c @@ -99,7 +99,7 @@ void switch_interrupt(enum gpio_signal signal) } #ifdef CONFIG_CMD_MMAPINFO -static int command_mmapinfo(int argc, char **argv) +static int command_mmapinfo(int argc, const char **argv) { uint8_t *memmap_switches = host_get_memmap(EC_MEMMAP_SWITCHES); uint8_t val = *memmap_switches; diff --git a/common/system.c b/common/system.c index 6b91767065..d19ffefe0a 100644 --- a/common/system.c +++ b/common/system.c @@ -1121,7 +1121,7 @@ static int sysinfo(struct ec_response_sysinfo *info) return EC_SUCCESS; } -static int command_sysinfo(int argc, char **argv) +static int command_sysinfo(int argc, const char **argv) { struct ec_response_sysinfo info; int rv; @@ -1176,7 +1176,7 @@ DECLARE_HOST_COMMAND(EC_CMD_SYSINFO, host_command_sysinfo, #endif #ifdef CONFIG_CMD_SCRATCHPAD -static int command_scratchpad(int argc, char **argv) +static int command_scratchpad(int argc, const char **argv) { int rv = EC_SUCCESS; uint32_t scratchpad_value; @@ -1206,7 +1206,7 @@ DECLARE_CONSOLE_COMMAND(scratchpad, command_scratchpad, "[val]", "Get or set scratchpad value"); #endif /* CONFIG_CMD_SCRATCHPAD */ -__maybe_unused static int command_hibernate(int argc, char **argv) +__maybe_unused static int command_hibernate(int argc, const char **argv) { int seconds = 0; int microseconds = 0; @@ -1277,7 +1277,7 @@ static void print_build_string(void) ccprintf("\n"); } -static int command_version(int argc, char **argv) +static int command_version(int argc, const char **argv) { int board_version; const char *fw_version; @@ -1349,7 +1349,7 @@ static int command_version(int argc, char **argv) DECLARE_SAFE_CONSOLE_COMMAND(version, command_version, NULL, "Print versions"); #ifdef CONFIG_CMD_SYSJUMP -static int command_sysjump(int argc, char **argv) +static int command_sysjump(int argc, const char **argv) { uint32_t addr; char *e; @@ -1393,7 +1393,7 @@ DECLARE_CONSOLE_COMMAND(sysjump, command_sysjump, "Jump to a system image or address"); #endif -static int command_reboot(int argc, char **argv) +static int command_reboot(int argc, const char **argv) { int flags = SYSTEM_RESET_MANUALLY_TRIGGERED; int i; @@ -1440,7 +1440,7 @@ DECLARE_CONSOLE_COMMAND( "Reboot the EC"); #ifdef CONFIG_CMD_SYSLOCK -static int command_system_lock(int argc, char **argv) +static int command_system_lock(int argc, const char **argv) { force_locked = 1; return EC_SUCCESS; @@ -1454,7 +1454,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(syslock, command_system_lock, NULL, * Modify and print the sleep mask which controls access to deep sleep * mode in the idle task. */ -static int command_sleepmask(int argc, char **argv) +static int command_sleepmask(int argc, const char **argv) { #ifdef CONFIG_CMD_SLEEPMASK_SET int v; @@ -1486,7 +1486,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(sleepmask, command_sleepmask, #endif #ifdef CONFIG_CMD_JUMPTAGS -static int command_jumptags(int argc, char **argv) +static int command_jumptags(int argc, const char **argv) { const struct jump_tag *t; int used = 0; @@ -1511,7 +1511,7 @@ DECLARE_CONSOLE_COMMAND(jumptags, command_jumptags, NULL, "List jump tags"); #endif /* CONFIG_CMD_JUMPTAGS */ #ifdef CONFIG_EMULATED_SYSRQ -static int command_sysrq(int argc, char **argv) +static int command_sysrq(int argc, const char **argv) { char key = 'x'; @@ -1527,7 +1527,7 @@ DECLARE_CONSOLE_COMMAND(sysrq, command_sysrq, "[key]", #endif /* CONFIG_EMULATED_SYSRQ */ #ifdef CONFIG_CMD_RESET_FLAGS -static int command_rflags(int argc, char **argv) +static int command_rflags(int argc, const char **argv) { print_reset_flags(chip_read_reset_flags()); ccprintf("\n"); diff --git a/common/tablet_mode.c b/common/tablet_mode.c index 52507147d8..a3971a0548 100644 --- a/common/tablet_mode.c +++ b/common/tablet_mode.c @@ -174,7 +174,7 @@ void gmr_tablet_switch_disable(void) #endif #ifdef CONFIG_TABLET_MODE -static int command_settabletmode(int argc, char **argv) +static int command_settabletmode(int argc, const char **argv) { static uint32_t tablet_mode_store; diff --git a/common/temp_sensor.c b/common/temp_sensor.c index 3b5fca780b..d28eac530f 100644 --- a/common/temp_sensor.c +++ b/common/temp_sensor.c @@ -142,7 +142,7 @@ int print_temps(void) /* Console commands */ #ifdef CONFIG_CMD_TEMP_SENSOR -static int command_temps(int argc, char **argv) +static int command_temps(int argc, const char **argv) { return print_temps(); } diff --git a/common/test_util.c b/common/test_util.c index 79eec44c6e..2591465c8e 100644 --- a/common/test_util.c +++ b/common/test_util.c @@ -29,7 +29,7 @@ struct test_util_tag { int __test_error_count; /* Weak reference function as an entry point for unit test */ -test_mockable void run_test(int argc, char **argv) +test_mockable void run_test(int argc, const char **argv) { } @@ -214,7 +214,7 @@ static void preserve_state(void) } DECLARE_HOOK(HOOK_SYSJUMP, preserve_state, HOOK_PRIO_DEFAULT); -static int command_run_test(int argc, char **argv) +static int command_run_test(int argc, const char **argv) { run_test(argc, argv); return EC_SUCCESS; diff --git a/common/thermal.c b/common/thermal.c index 7230ae2e73..f84d42f8fc 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -241,7 +241,7 @@ DECLARE_HOOK(HOOK_SECOND, thermal_control, HOOK_PRIO_TEMP_SENSOR_DONE); /*****************************************************************************/ /* Console commands */ -static int command_thermalget(int argc, char **argv) +static int command_thermalget(int argc, const char **argv) { int i; @@ -260,7 +260,7 @@ static int command_thermalget(int argc, char **argv) DECLARE_CONSOLE_COMMAND(thermalget, command_thermalget, NULL, "Print thermal parameters (degrees Kelvin)"); -static int command_thermalset(int argc, char **argv) +static int command_thermalset(int argc, const char **argv) { unsigned int n; int i, val; diff --git a/common/throttle_ap.c b/common/throttle_ap.c index a3b1745972..5ab889abe7 100644 --- a/common/throttle_ap.c +++ b/common/throttle_ap.c @@ -180,7 +180,7 @@ void throttle_ap_c10_input_interrupt(enum gpio_signal signal) /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_APTHROTTLE -static int command_apthrottle(int argc, char **argv) +static int command_apthrottle(int argc, const char **argv) { int i; uint32_t tmpval; diff --git a/common/timer.c b/common/timer.c index 700eb9b509..29e79c1569 100644 --- a/common/timer.c +++ b/common/timer.c @@ -353,7 +353,7 @@ static void timer_sysjump(void) DECLARE_HOOK(HOOK_SYSJUMP, timer_sysjump, HOOK_PRIO_DEFAULT); #ifdef CONFIG_CMD_WAITMS -static int command_wait(int argc, char **argv) +static int command_wait(int argc, const char **argv) { char *e; int i; @@ -396,7 +396,7 @@ DECLARE_CONSOLE_COMMAND(waitms, command_wait, "msec", * especially when going "backward" in time, because task deadlines are * left un-adjusted. */ -static int command_force_time(int argc, char **argv) +static int command_force_time(int argc, const char **argv) { char *e; timestamp_t new; @@ -422,7 +422,7 @@ DECLARE_CONSOLE_COMMAND(forcetime, command_force_time, "hi lo", #endif #ifdef CONFIG_CMD_GETTIME -static int command_get_time(int argc, char **argv) +static int command_get_time(int argc, const char **argv) { timestamp_t ts = get_time(); ccprintf("Time: 0x%016llx = %.6lld s\n", ts.val, ts.val); @@ -434,7 +434,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(gettime, command_get_time, NULL, #endif #ifdef CONFIG_CMD_TIMERINFO -static int command_timer_info(int argc, char **argv) +static int command_timer_info(int argc, const char **argv) { timer_print_info(); diff --git a/common/usb_common.c b/common/usb_common.c index 59eaf7946b..f0a8ad52f6 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -912,7 +912,7 @@ void tcpc_dump_registers(int port, const struct tcpc_reg_dump_map *reg, } } -static int command_tcpc_dump(int argc, char **argv) +static int command_tcpc_dump(int argc, const char **argv) { int port; diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c index 33fde9b14d..b37edb5b24 100644 --- a/common/usb_pd_alt_mode_dfp.c +++ b/common/usb_pd_alt_mode_dfp.c @@ -1496,7 +1496,7 @@ const struct svdm_amode_fx supported_modes[] = { const int supported_modes_cnt = ARRAY_SIZE(supported_modes); #ifdef CONFIG_CMD_MFALLOW -static int command_mfallow(int argc, char **argv) +static int command_mfallow(int argc, const char **argv) { char *e; int port; diff --git a/common/usb_pd_console_cmd.c b/common/usb_pd_console_cmd.c index a04ef785f9..96ae17b731 100644 --- a/common/usb_pd_console_cmd.c +++ b/common/usb_pd_console_cmd.c @@ -75,7 +75,7 @@ static void dump_pe(int port) } } -static int command_pe(int argc, char **argv) +static int command_pe(int argc, const char **argv) { int port; char *e; @@ -106,7 +106,7 @@ static const char *const cable_curr[] = { [USB_VBUS_CUR_5A] = "5A", }; -static int command_cable(int argc, char **argv) +static int command_cable(int argc, const char **argv) { int port; char *e; diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 8b52d44668..6d214729f8 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -5110,7 +5110,7 @@ void pd_update_contract(int port) #endif /* CONFIG_USB_PD_DUAL_ROLE */ -static int command_pd(int argc, char **argv) +static int command_pd(int argc, const char **argv) { int port; char *e; diff --git a/common/usb_pd_tcpc.c b/common/usb_pd_tcpc.c index 7c7690adec..4ae6095f7b 100644 --- a/common/usb_pd_tcpc.c +++ b/common/usb_pd_tcpc.c @@ -1406,7 +1406,7 @@ void tcpc_i2c_process(int read, int port, int len, uint8_t *payload, #endif #ifdef CONFIG_COMMON_RUNTIME -static int command_tcpc(int argc, char **argv) +static int command_tcpc(int argc, const char **argv) { int port; char *e; diff --git a/common/usb_port_power_dumb.c b/common/usb_port_power_dumb.c index f1f1881b6e..ae48ce3c85 100644 --- a/common/usb_port_power_dumb.c +++ b/common/usb_port_power_dumb.c @@ -87,7 +87,7 @@ DECLARE_HOST_COMMAND(EC_CMD_USB_CHARGE_SET_MODE, usb_port_command_set_mode, /*****************************************************************************/ /* Console commands */ -static int command_set_mode(int argc, char **argv) +static int command_set_mode(int argc, const char **argv) { int port_id = -1; int mode = -1; diff --git a/common/usb_port_power_smart.c b/common/usb_port_power_smart.c index 9313993842..c67709ab07 100644 --- a/common/usb_port_power_smart.c +++ b/common/usb_port_power_smart.c @@ -145,7 +145,7 @@ int usb_charge_set_mode(int port_id, enum usb_charge_mode mode, /*****************************************************************************/ /* Console commands */ -static int command_set_mode(int argc, char **argv) +static int command_set_mode(int argc, const char **argv) { int port_id = -1; int mode = -1, inhibit_charge = 0; diff --git a/common/usbc/usb_pd_console.c b/common/usbc/usb_pd_console.c index 332b32c7a3..56901fe3c6 100644 --- a/common/usbc/usb_pd_console.c +++ b/common/usbc/usb_pd_console.c @@ -17,7 +17,7 @@ static #endif int - command_pd(int argc, char **argv) + command_pd(int argc, const char **argv) { int port; char *e; diff --git a/common/usbc_ppc.c b/common/usbc_ppc.c index c22d3b862f..419015c7c7 100644 --- a/common/usbc_ppc.c +++ b/common/usbc_ppc.c @@ -304,7 +304,7 @@ int ppc_is_vbus_present(int port) #endif /* defined(CONFIG_USB_PD_VBUS_DETECT_PPC) */ #ifdef CONFIG_CMD_PPC_DUMP -static int command_ppc_dump(int argc, char **argv) +static int command_ppc_dump(int argc, const char **argv) { int port; int rv = EC_ERROR_UNIMPLEMENTED; diff --git a/common/util.c b/common/util.c index a090bd1575..744b912645 100644 --- a/common/util.c +++ b/common/util.c @@ -269,7 +269,8 @@ int cond_went(cond_t *c, int val) * *offset<0. If argc<shift+1, leaves size unchanged, returning error if * *size<0. */ -int parse_offset_size(int argc, char **argv, int shift, int *offset, int *size) +int parse_offset_size(int argc, const char **argv, int shift, int *offset, + int *size) { char *e; int i; diff --git a/common/vboot/vb21_lib.c b/common/vboot/vb21_lib.c index 107f2d9ac1..3f79b56258 100644 --- a/common/vboot/vb21_lib.c +++ b/common/vboot/vb21_lib.c @@ -74,7 +74,7 @@ static void read_rwsig_info(struct ec_response_rwsig_info *r) r->key_is_valid = (rv == EC_SUCCESS); } -static int command_rwsig_info(int argc, char **argv) +static int command_rwsig_info(int argc, const char **argv) { int i; struct ec_response_rwsig_info r; diff --git a/common/vboot_hash.c b/common/vboot_hash.c index aa878fedd0..34cb603f5e 100644 --- a/common/vboot_hash.c +++ b/common/vboot_hash.c @@ -339,7 +339,7 @@ static int get_offset(int offset) /****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_HASH -static int command_hash(int argc, char **argv) +static int command_hash(int argc, const char **argv) { uint32_t offset = CONFIG_EC_WRITABLE_STORAGE_OFF + CONFIG_RW_STORAGE_OFF; diff --git a/common/wireless.c b/common/wireless.c index fffe66cb55..cf0e959d52 100644 --- a/common/wireless.c +++ b/common/wireless.c @@ -134,7 +134,7 @@ static enum ec_status wireless_enable_cmd(struct host_cmd_handler_args *args) DECLARE_HOST_COMMAND(EC_CMD_SWITCH_ENABLE_WIRELESS, wireless_enable_cmd, EC_VER_MASK(0) | EC_VER_MASK(1)); -static int command_wireless(int argc, char **argv) +static int command_wireless(int argc, const char **argv) { char *e; int i; diff --git a/core/cortex-m/llsr.c b/core/cortex-m/llsr.c index 85f4f7d804..3bbdd1370c 100644 --- a/core/cortex-m/llsr.c +++ b/core/cortex-m/llsr.c @@ -29,7 +29,7 @@ uint64_t __keep __aeabi_llsr(uint64_t v, uint32_t shift) #ifdef CONFIG_LLSR_TEST -static int command_llsr(int argc, char **argv) +static int command_llsr(int argc, const char **argv) { /* Volatile to prevent compilier optimization from interfering. */ volatile uint64_t start = 0x123456789ABCDEF0ull; diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index f4315f32b1..55e97316ca 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -969,7 +969,7 @@ void task_print_list(void) } } -static int command_task_info(int argc, char **argv) +static int command_task_info(int argc, const char **argv) { #ifdef CONFIG_TASK_PROFILING int total = 0; @@ -1002,7 +1002,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(taskinfo, command_task_info, NULL, "Print task info"); #ifdef CONFIG_CMD_TASKREADY -static int command_task_ready(int argc, char **argv) +static int command_task_ready(int argc, const char **argv) { if (argc < 2) { ccprintf("tasks_ready: 0x%08x\n", (int)tasks_ready); @@ -1069,7 +1069,7 @@ int task_start(void) } #ifdef CONFIG_CMD_TASK_RESET -static int command_task_reset(int argc, char **argv) +static int command_task_reset(int argc, const char **argv) { task_id_t id; char *e; diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index edb8688e4a..2647126a52 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -576,7 +576,7 @@ void task_print_list(void) } } -static int command_task_info(int argc, char **argv) +static int command_task_info(int argc, const char **argv) { #ifdef CONFIG_TASK_PROFILING int total = 0; @@ -608,7 +608,7 @@ static int command_task_info(int argc, char **argv) DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info, NULL, "Print task info"); #ifdef CONFIG_CMD_TASKREADY -static int command_task_ready(int argc, char **argv) +static int command_task_ready(int argc, const char **argv) { if (argc < 2) { ccprintf("tasks_ready: 0x%08x\n", (int)tasks_ready); diff --git a/core/host/task.c b/core/host/task.c index 4af894d6c3..e896d6e45c 100644 --- a/core/host/task.c +++ b/core/host/task.c @@ -315,7 +315,7 @@ void task_print_list(void) } } -static int command_task_info(int argc, char **argv) +static int command_task_info(int argc, const char **argv) { task_print_list(); diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c index ade530e04c..5b8c0b7c05 100644 --- a/core/minute-ia/task.c +++ b/core/minute-ia/task.c @@ -536,7 +536,7 @@ void task_print_list(void) } } -static int command_task_info(int argc, char **argv) +static int command_task_info(int argc, const char **argv) { task_print_list(); @@ -568,7 +568,7 @@ static int command_task_info(int argc, char **argv) } DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info, NULL, "Print task info"); -__maybe_unused static int command_task_ready(int argc, char **argv) +__maybe_unused static int command_task_ready(int argc, const char **argv) { if (argc < 2) { ccprintf("tasks_ready: 0x%08x\n", (int)tasks_ready); diff --git a/core/nds32/task.c b/core/nds32/task.c index c384e291f3..1edd55f06f 100644 --- a/core/nds32/task.c +++ b/core/nds32/task.c @@ -678,7 +678,7 @@ void task_print_list(void) } } -static int command_task_info(int argc, char **argv) +static int command_task_info(int argc, const char **argv) { #ifdef CONFIG_TASK_PROFILING int total = 0; @@ -710,7 +710,7 @@ static int command_task_info(int argc, char **argv) } DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info, NULL, "Print task info"); -static int command_task_ready(int argc, char **argv) +static int command_task_ready(int argc, const char **argv) { if (argc < 2) { ccprintf("tasks_ready: 0x%08x\n", (int)tasks_ready); diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c index fe3117d5a7..01e2ace31e 100644 --- a/core/riscv-rv32i/task.c +++ b/core/riscv-rv32i/task.c @@ -611,7 +611,7 @@ void task_print_list(void) } } -static int command_task_info(int argc, char **argv) +static int command_task_info(int argc, const char **argv) { #ifdef CONFIG_TASK_PROFILING unsigned int total = 0; @@ -643,7 +643,7 @@ static int command_task_info(int argc, char **argv) } DECLARE_CONSOLE_COMMAND(taskinfo, command_task_info, NULL, "Print task info"); -static int command_task_ready(int argc, char **argv) +static int command_task_ready(int argc, const char **argv) { if (argc < 2) { ccprintf("tasks_ready: 0x%08x\n", (int)tasks_ready); diff --git a/driver/amd_stt.c b/driver/amd_stt.c index a93992784c..50ebb9fb9d 100644 --- a/driver/amd_stt.c +++ b/driver/amd_stt.c @@ -110,7 +110,7 @@ static void amd_stt_handler(void) } DECLARE_HOOK(HOOK_SECOND, amd_stt_handler, HOOK_PRIO_TEMP_SENSOR + 1); -static int command_stt(int argc, char **argv) +static int command_stt(int argc, const char **argv) { int sensor_id; int temp; diff --git a/driver/battery/bq27541.c b/driver/battery/bq27541.c index b063d220bf..a7af8071eb 100644 --- a/driver/battery/bq27541.c +++ b/driver/battery/bq27541.c @@ -389,7 +389,7 @@ enum battery_disconnect_state battery_get_disconnect_state(void) } #endif /* CONFIG_BATTERY_REVIVE_DISCONNECT */ -static int command_battfake(int argc, char **argv) +static int command_battfake(int argc, const char **argv) { char *e; int v; diff --git a/driver/battery/bq27621_g1.c b/driver/battery/bq27621_g1.c index cd11b2f269..1995d93eb5 100644 --- a/driver/battery/bq27621_g1.c +++ b/driver/battery/bq27621_g1.c @@ -567,7 +567,7 @@ int battery_wait_for_stable(void) #ifdef CONFIG_CMD_BATDEBUG -static int command_fgunseal(int argc, char **argv) +static int command_fgunseal(int argc, const char **argv) { int rv = EC_SUCCESS; @@ -581,7 +581,7 @@ static int command_fgunseal(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fgunseal, command_fgunseal, "", "Unseal the fg"); -static int command_fgseal(int argc, char **argv) +static int command_fgseal(int argc, const char **argv) { int rv = EC_SUCCESS; @@ -595,7 +595,7 @@ static int command_fgseal(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fgseal, command_fgseal, "", "Seal the fg"); -static int command_fginit(int argc, char **argv) +static int command_fginit(int argc, const char **argv) { int rv = EC_SUCCESS; int force = 0; @@ -628,7 +628,7 @@ static int command_fginit(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fginit, command_fginit, "[force]", "Initialize the fg"); -static int command_fgprobe(int argc, char **argv) +static int command_fgprobe(int argc, const char **argv) { int rv = EC_SUCCESS; @@ -642,7 +642,7 @@ static int command_fgprobe(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fgprobe, command_fgprobe, "", "Probe the fg"); -static int command_fgrd(int argc, char **argv) +static int command_fgrd(int argc, const char **argv) { int cmd, len; int rv = EC_SUCCESS; @@ -675,7 +675,7 @@ static int command_fgrd(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fgrd, command_fgrd, "cmd len", "Read _len_ words from the fg"); -static int command_fgcmd(int argc, char **argv) +static int command_fgcmd(int argc, const char **argv) { int cmd, data, byte = 0; char *e; @@ -709,7 +709,7 @@ static int command_fgcmd(int argc, char **argv) DECLARE_CONSOLE_COMMAND(fgcmd, command_fgcmd, "cmd data [byte]", "Send a cmd to the fg"); -static int command_fgcmdrd(int argc, char **argv) +static int command_fgcmdrd(int argc, const char **argv) { int cmd, data, val; int rv = EC_SUCCESS; diff --git a/driver/battery/smart.c b/driver/battery/smart.c index 5d56f2602a..8d3db27f0f 100644 --- a/driver/battery/smart.c +++ b/driver/battery/smart.c @@ -526,7 +526,7 @@ int battery_wait_for_stable(void) } #if defined(CONFIG_CMD_BATTFAKE) -static int command_battfake(int argc, char **argv) +static int command_battfake(int argc, const char **argv) { char *e; int v; @@ -548,7 +548,7 @@ DECLARE_CONSOLE_COMMAND(battfake, command_battfake, "percent (-1 = use real level)", "Set fake battery level"); -static int command_batttempfake(int argc, char **argv) +static int command_batttempfake(int argc, const char **argv) { char *e; int t; @@ -574,7 +574,7 @@ DECLARE_CONSOLE_COMMAND( #endif #ifdef CONFIG_CMD_BATT_MFG_ACCESS -static int command_batt_mfg_access_read(int argc, char **argv) +static int command_batt_mfg_access_read(int argc, const char **argv) { char *e; uint8_t data[32]; diff --git a/driver/charger/bd9995x.c b/driver/charger/bd9995x.c index 896da5a523..a50f73e206 100644 --- a/driver/charger/bd9995x.c +++ b/driver/charger/bd9995x.c @@ -1492,7 +1492,7 @@ static void console_bd9995x_dump_regs(int chgnum) #endif /* CONFIG_CMD_CHARGER_DUMP */ #ifdef CONFIG_CMD_CHARGER -static int console_command_bd9995x(int argc, char **argv) +static int console_command_bd9995x(int argc, const char **argv) { int rv, reg, data, val; char rw, *e; @@ -1590,7 +1590,7 @@ static int bd9995x_enable_psys(int chgnum) * update "psys" console command to use charger_get_system_power and move it * to some common code. */ -static int console_command_psys(int argc, char **argv) +static int console_command_psys(int argc, const char **argv) { int rv; @@ -1677,7 +1677,7 @@ static int bd9995x_amon_bmon(int chgnum, int amon_bmon) /** * Get charger AMON and BMON current. */ -static int console_command_amon_bmon(int argc, char **argv) +static int console_command_amon_bmon(int argc, const char **argv) { int rv = EC_ERROR_PARAM1; diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c index e3a67ab2b6..ff3a13a37a 100644 --- a/driver/charger/isl923x.c +++ b/driver/charger/isl923x.c @@ -1107,7 +1107,7 @@ int charger_get_system_power(void) return adc; } -static int console_command_psys(int argc, char **argv) +static int console_command_psys(int argc, const char **argv) { ccprintf("PSYS = %d uW\n", charger_get_system_power()); return 0; @@ -1137,7 +1137,7 @@ static int print_amon_bmon(int chgnum, enum isl923x_amon_bmon amon, /** * Get charger AMON and BMON current. */ -static int console_command_amon_bmon(int argc, char **argv) +static int console_command_amon_bmon(int argc, const char **argv) { int ret = EC_SUCCESS; int print_ac = 1; diff --git a/driver/charger/sy21612.c b/driver/charger/sy21612.c index 6089de1ee7..427bc595e8 100644 --- a/driver/charger/sy21612.c +++ b/driver/charger/sy21612.c @@ -184,7 +184,7 @@ void sy21612_task(void *u) #endif #ifdef CONFIG_CMD_CHARGER -static int command_sy21612(int argc, char **argv) +static int command_sy21612(int argc, const char **argv) { int i, val, rv; diff --git a/driver/gl3590.c b/driver/gl3590.c index 201228c368..27650c6204 100644 --- a/driver/gl3590.c +++ b/driver/gl3590.c @@ -306,7 +306,7 @@ int gl3590_enable_ports(int hub, uint8_t port_mask, bool enable) } #ifdef CONFIG_CMD_GL3590 -static int command_gl3590(int argc, char **argv) +static int command_gl3590(int argc, const char **argv) { char *e; int port; diff --git a/driver/ina2xx.c b/driver/ina2xx.c index 6a785d1122..3691e62503 100644 --- a/driver/ina2xx.c +++ b/driver/ina2xx.c @@ -122,7 +122,7 @@ static void ina2xx_dump(uint8_t idx) /*****************************************************************************/ /* Console commands */ -static int command_ina(int argc, char **argv) +static int command_ina(int argc, const char **argv) { char *e; int idx; diff --git a/driver/ina3221.c b/driver/ina3221.c index 3220cebd23..67f0c5710a 100644 --- a/driver/ina3221.c +++ b/driver/ina3221.c @@ -121,7 +121,7 @@ static void ina3221_dump(unsigned int unit) /*****************************************************************************/ /* Console commands */ -static int command_ina(int argc, char **argv) +static int command_ina(int argc, const char **argv) { char *e; unsigned int unit; diff --git a/driver/ioexpander/it8801.c b/driver/ioexpander/it8801.c index 382f6dc547..eddd20b56d 100644 --- a/driver/ioexpander/it8801.c +++ b/driver/ioexpander/it8801.c @@ -561,7 +561,7 @@ static void dump_register(int reg) ccprintf("ERR (%d)\n", rv); } -static int it8801_dump(int argc, char **argv) +static int it8801_dump(int argc, const char **argv) { dump_register(IT8801_REG_KSIIER); dump_register(IT8801_REG_KSIEER); diff --git a/driver/led/ds2413.c b/driver/led/ds2413.c index 1529d84772..202fddb1ce 100644 --- a/driver/led/ds2413.c +++ b/driver/led/ds2413.c @@ -149,7 +149,7 @@ DECLARE_HOOK(HOOK_SECOND, onewire_led_tick, HOOK_PRIO_DEFAULT); /*****************************************************************************/ /* Console commands */ #define CONFIG_CMD_POWERLED -static int command_powerled(int argc, char **argv) +static int command_powerled(int argc, const char **argv) { int i; diff --git a/driver/led/lp5562.c b/driver/led/lp5562.c index e0758a8b91..8e8716213c 100644 --- a/driver/led/lp5562.c +++ b/driver/led/lp5562.c @@ -123,7 +123,7 @@ int lp5562_set_pc(int engine, int val) /*****************************************************************************/ /* Console commands */ #ifdef CONFIG_CMD_POWERLED -static int command_lp5562(int argc, char **argv) +static int command_lp5562(int argc, const char **argv) { if (argc == 4) { char *e; diff --git a/driver/mcdp28x0.c b/driver/mcdp28x0.c index 4502d00eca..4fd8289398 100644 --- a/driver/mcdp28x0.c +++ b/driver/mcdp28x0.c @@ -255,7 +255,7 @@ static int mcdp_appstest(uint8_t cmd, int paramc, char **paramv) return EC_SUCCESS; } -int command_mcdp(int argc, char **argv) +int command_mcdp(int argc, const char **argv) { int rv = EC_SUCCESS; char *e; diff --git a/driver/mp4245.c b/driver/mp4245.c index 097053de42..216fac120d 100644 --- a/driver/mp4245.c +++ b/driver/mp4245.c @@ -163,7 +163,7 @@ void mp4245_get_status(void) ccprintf("\tIlim = %d mA, Ibus = %d mA\n", ilim, ibus); } -static int command_mp4245(int argc, char **argv) +static int command_mp4245(int argc, const char **argv) { char *e; int val; diff --git a/driver/nfc/ctn730.c b/driver/nfc/ctn730.c index ea7eeb29df..5beaf5f489 100644 --- a/driver/nfc/ctn730.c +++ b/driver/nfc/ctn730.c @@ -663,7 +663,7 @@ const struct pchg_drv ctn730_drv = { .update_close = ctn730_update_close, }; -static int cc_ctn730(int argc, char **argv) +static int cc_ctn730(int argc, const char **argv) { int port; char *end; diff --git a/driver/regulator_ir357x.c b/driver/regulator_ir357x.c index 3120bbc0ab..94c42d37f9 100644 --- a/driver/regulator_ir357x.c +++ b/driver/regulator_ir357x.c @@ -195,7 +195,7 @@ static int ir357x_check(void) } #ifdef CONFIG_CMD_REGULATOR -static int command_ir357x(int argc, char **argv) +static int command_ir357x(int argc, const char **argv) { int reg, val; char *rem; diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c index 10607a4a58..4123e76c23 100644 --- a/driver/retimer/bb_retimer.c +++ b/driver/retimer/bb_retimer.c @@ -624,7 +624,7 @@ const struct usb_mux_driver bb_usb_retimer = { }; #ifdef CONFIG_CMD_RETIMER -static int console_command_bb_retimer(int argc, char **argv) +static int console_command_bb_retimer(int argc, const char **argv) { char rw, *e; int port, reg, data, val = 0; diff --git a/driver/retimer/kb800x.c b/driver/retimer/kb800x.c index 18eda4f66a..0581b813c9 100644 --- a/driver/retimer/kb800x.c +++ b/driver/retimer/kb800x.c @@ -474,7 +474,7 @@ static int kb800x_enter_low_power_mode(const struct usb_mux *me) #ifdef CONFIG_CMD_RETIMER -static int console_command_kb800x_xfer(int argc, char **argv) +static int console_command_kb800x_xfer(int argc, const char **argv) { char rw, *e; int rv, port, reg, val; diff --git a/driver/sync.c b/driver/sync.c index bedacbe5fc..1fdb8d2589 100644 --- a/driver/sync.c +++ b/driver/sync.c @@ -106,7 +106,7 @@ static int sync_init(struct motion_sensor_t *s) } #ifdef CONFIG_SYNC_COMMAND -static int command_sync(int argc, char **argv) +static int command_sync(int argc, const char **argv) { int count = 1, i; diff --git a/driver/tcpm/anx7447.c b/driver/tcpm/anx7447.c index 0aa732d0b8..954e2a82d7 100644 --- a/driver/tcpm/anx7447.c +++ b/driver/tcpm/anx7447.c @@ -250,7 +250,7 @@ int anx7447_flash_erase(int port) } /* Add console command to erase OCM flash if needed. */ -static int command_anx_ocm(int argc, char **argv) +static int command_anx_ocm(int argc, const char **argv) { char *e = NULL; int port; diff --git a/driver/tcpm/rt1718s.c b/driver/tcpm/rt1718s.c index 319d1b14af..ff6b70075b 100644 --- a/driver/tcpm/rt1718s.c +++ b/driver/tcpm/rt1718s.c @@ -728,7 +728,7 @@ int rt1718s_gpio_get_level(int port, enum rt1718s_gpio signal) return !!(val & RT1718S_GPIO_CTRL_I); } -static int command_rt1718s_gpio(int argc, char **argv) +static int command_rt1718s_gpio(int argc, const char **argv) { int i, j; uint32_t flags; diff --git a/driver/temp_sensor/adt7481.c b/driver/temp_sensor/adt7481.c index c26247f80c..4f4e2ff358 100644 --- a/driver/temp_sensor/adt7481.c +++ b/driver/temp_sensor/adt7481.c @@ -254,7 +254,7 @@ static int print_status(void) return EC_SUCCESS; } -static int command_adt7481(int argc, char **argv) +static int command_adt7481(int argc, const char **argv) { char *command; char *e; diff --git a/driver/temp_sensor/f75303.c b/driver/temp_sensor/f75303.c index 0a944f2d8d..51c56686a4 100644 --- a/driver/temp_sensor/f75303.c +++ b/driver/temp_sensor/f75303.c @@ -58,7 +58,7 @@ static void f75303_sensor_poll(void) } DECLARE_HOOK(HOOK_SECOND, f75303_sensor_poll, HOOK_PRIO_TEMP_SENSOR); -static int f75303_set_fake_temp(int argc, char **argv) +static int f75303_set_fake_temp(int argc, const char **argv) { int index; int value; diff --git a/driver/temp_sensor/g753.c b/driver/temp_sensor/g753.c index 5dbc47064a..65968cd021 100644 --- a/driver/temp_sensor/g753.c +++ b/driver/temp_sensor/g753.c @@ -128,9 +128,9 @@ static int print_status(void) return EC_SUCCESS; } -static int command_g753(int argc, char **argv) +static int command_g753(int argc, const char **argv) { - char *command; + const char *command; char *e; int data; int offset; diff --git a/driver/temp_sensor/g78x.c b/driver/temp_sensor/g78x.c index 22af57c2d8..7530c56c16 100644 --- a/driver/temp_sensor/g78x.c +++ b/driver/temp_sensor/g78x.c @@ -171,7 +171,7 @@ static int print_status(void) return EC_SUCCESS; } -static int command_g78x(int argc, char **argv) +static int command_g78x(int argc, const char **argv) { char *command; char *e; diff --git a/driver/temp_sensor/tmp006.c b/driver/temp_sensor/tmp006.c index 265d9d804e..334979e826 100644 --- a/driver/temp_sensor/tmp006.c +++ b/driver/temp_sensor/tmp006.c @@ -402,7 +402,7 @@ static int tmp006_print(int idx) return EC_SUCCESS; } -static int command_sensor_info(int argc, char **argv) +static int command_sensor_info(int argc, const char **argv) { int i; int rv, rv1; @@ -433,7 +433,7 @@ DECLARE_CONSOLE_COMMAND(tmp006, command_sensor_info, "[ <index> ]", /* Disable the t6cal command until/unless we have FP support in printf */ #if 0 -static int command_t6cal(int argc, char **argv) +static int command_t6cal(int argc, const char **argv) { struct tmp006_data_t *tdata; char *e; diff --git a/driver/temp_sensor/tmp411.c b/driver/temp_sensor/tmp411.c index 804fa30644..6fcc65c5b4 100644 --- a/driver/temp_sensor/tmp411.c +++ b/driver/temp_sensor/tmp411.c @@ -233,7 +233,7 @@ static int print_status(void) return EC_SUCCESS; } -static int command_tmp411(int argc, char **argv) +static int command_tmp411(int argc, const char **argv) { char *command; char *e; diff --git a/driver/temp_sensor/tmp432.c b/driver/temp_sensor/tmp432.c index 54414a2f3e..6afb81b6c6 100644 --- a/driver/temp_sensor/tmp432.c +++ b/driver/temp_sensor/tmp432.c @@ -297,11 +297,11 @@ static int print_status(void) return EC_SUCCESS; } -static int command_tmp432(int argc, char **argv) +static int command_tmp432(int argc, const char **argv) { - char *command; + const char *command; char *e; - char *power; + const char *power; int data; int offset; int rv; diff --git a/driver/touchpad_gt7288.c b/driver/touchpad_gt7288.c index deb4665e09..1dcfdbfb61 100644 --- a/driver/touchpad_gt7288.c +++ b/driver/touchpad_gt7288.c @@ -125,7 +125,7 @@ int gt7288_read_ptp_report(struct gt7288_ptp_report *report) } #ifdef CONFIG_CMD_GT7288 -static int command_gt7288_read_desc(int argc, char **argv) +static int command_gt7288_read_desc(int argc, const char **argv) { uint16_t register_id; long parsed_arg; @@ -152,7 +152,7 @@ static int command_gt7288_read_desc(int argc, char **argv) DECLARE_CONSOLE_COMMAND(gt7288_desc, command_gt7288_read_desc, "register", "Read a descriptor on the GT7288"); -static int command_gt7288_read_report_descriptor(int argc, char **argv) +static int command_gt7288_read_report_descriptor(int argc, const char **argv) { int i; uint8_t data[64]; @@ -183,7 +183,7 @@ static int command_gt7288_read_report_descriptor(int argc, char **argv) DECLARE_CONSOLE_COMMAND(gt7288_repdesc, command_gt7288_read_report_descriptor, "", "Read the report descriptor on the GT7288"); -static int command_gt7288_ver(int argc, char **argv) +static int command_gt7288_ver(int argc, const char **argv) { struct gt7288_version_info info; @@ -198,7 +198,7 @@ static int command_gt7288_ver(int argc, char **argv) DECLARE_CONSOLE_COMMAND(gt7288_ver, command_gt7288_ver, "", "Read version information from the GT7288"); -static int command_gt7288_report(int argc, char **argv) +static int command_gt7288_report(int argc, const char **argv) { int i; struct gt7288_ptp_report report; diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c index e5fab5ef7d..87b1a30bc5 100644 --- a/driver/touchpad_st.c +++ b/driver/touchpad_st.c @@ -1801,7 +1801,7 @@ USB_DECLARE_EP(USB_EP_ST_TOUCHPAD_INT, st_tp_interrupt_tx, st_tp_interrupt_tx, #endif /* Debugging commands */ -static int command_touchpad_st(int argc, char **argv) +static int command_touchpad_st(int argc, const char **argv) { if (argc < 2) return EC_ERROR_PARAM_COUNT; diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c index 778d518e0a..970d06a63d 100644 --- a/driver/usb_mux/usb_mux.c +++ b/driver/usb_mux/usb_mux.c @@ -710,7 +710,7 @@ static void usb_mux_reset_in_g3(void) DECLARE_HOOK(HOOK_CHIPSET_HARD_OFF, usb_mux_reset_in_g3, HOOK_PRIO_DEFAULT); #ifdef CONFIG_CMD_TYPEC -static int command_typec(int argc, char **argv) +static int command_typec(int argc, const char **argv) { const char *const mux_name[] = { "none", "usb", "dp", "dock" }; char *e; diff --git a/driver/wpc/cps8100.c b/driver/wpc/cps8100.c index ffb81e3a91..4fef177fff 100644 --- a/driver/wpc/cps8100.c +++ b/driver/wpc/cps8100.c @@ -399,7 +399,7 @@ static void cps8100_dump(struct pchg *ctx) cps8100_print_alert_info(val); } -static int cc_cps8100(int argc, char **argv) +static int cc_cps8100(int argc, const char **argv) { struct pchg *ctx; char *end; diff --git a/fuzz/host_command_fuzz.c b/fuzz/host_command_fuzz.c index d8d2408838..fac8fdedbe 100644 --- a/fuzz/host_command_fuzz.c +++ b/fuzz/host_command_fuzz.c @@ -135,7 +135,7 @@ static int hostcmd_fill(const uint8_t *data, size_t size) static pthread_cond_t done_cond; static pthread_mutex_t lock; -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { ccprints("Fuzzing task started"); wait_for_task_started(); diff --git a/fuzz/pchg_fuzz.c b/fuzz/pchg_fuzz.c index e4a7cdd3fa..b19569e02e 100644 --- a/fuzz/pchg_fuzz.c +++ b/fuzz/pchg_fuzz.c @@ -93,7 +93,7 @@ void irq_task(int argc, char **argv) } } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { ccprints("Fuzzing task started"); task_wait_event(-1); diff --git a/fuzz/usb_pd_fuzz.c b/fuzz/usb_pd_fuzz.c index 4d67780a71..5d3a9ef9a6 100644 --- a/fuzz/usb_pd_fuzz.c +++ b/fuzz/usb_pd_fuzz.c @@ -192,7 +192,7 @@ enum tcpc_cc_voltage_status next_cc1, next_cc2; #define MAX_MESSAGES 8 static struct message messages[MAX_MESSAGES]; -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { uint8_t port = PORT0; int i; diff --git a/include/console.h b/include/console.h index 716b70d38f..cd3f9cb113 100644 --- a/include/console.h +++ b/include/console.h @@ -69,7 +69,7 @@ struct console_command { /* Command name. Case-insensitive. */ const char *name; /* Handler for the command. argv[0] will be the command name. */ - int (*handler)(int argc, char **argv); + int (*handler)(int argc, const char **argv); #ifdef CONFIG_CONSOLE_CMDHELP /* Description of args */ const char *argdesc; @@ -209,18 +209,18 @@ void console_has_input(void); * long (excluding null terminator). Note this is NOT in * quotes so it can be concatenated to form a struct name. * @param routine Command handling routine, of the form - * int handler(int argc, char **argv) + * int handler(int argc, const char **argv) * @param argdesc String describing arguments to command; NULL if none. * @param help String with one-line description of command, or NULL. * @param flags Per-command flags, if needed. */ #if !defined(HAS_TASK_CONSOLE) && !defined(CONFIG_ZEPHYR) #define DECLARE_CONSOLE_COMMAND(NAME, ROUTINE, ARGDESC, HELP) \ - static int(ROUTINE)(int argc, char **argv) __attribute__((unused)) + static int(ROUTINE)(int argc, const char **argv) __attribute__((unused)) #define DECLARE_SAFE_CONSOLE_COMMAND(NAME, ROUTINE, ARGDESC, HELP) \ - static int(ROUTINE)(int argc, char **argv) __attribute__((unused)) + static int(ROUTINE)(int argc, const char **argv) __attribute__((unused)) #define DECLARE_CONSOLE_COMMAND_FLAGS(NAME, ROUTINE, ARGDESC, HELP, FLAGS) \ - static int(ROUTINE)(int argc, char **argv) __attribute__((unused)) + static int(ROUTINE)(int argc, const char **argv) __attribute__((unused)) #elif defined(HAS_TASK_CONSOLE) /* We always provde help args, but we may discard them to save space. */ @@ -239,7 +239,7 @@ void console_has_input(void); /* This macro takes all possible args and discards the ones we don't use */ #define _DCL_CON_CMD_ALL(NAME, ROUTINE, ARGDESC, HELP, FLAGS) \ - static int(ROUTINE)(int argc, char **argv); \ + static int(ROUTINE)(int argc, const char **argv); \ static const char __con_cmd_label_##NAME[] = #NAME; \ _STATIC_ASSERT(sizeof(__con_cmd_label_##NAME) < 16, \ "command name '" #NAME "' is too long"); \ diff --git a/include/test_util.h b/include/test_util.h index 4be155605d..4df494a851 100644 --- a/include/test_util.h +++ b/include/test_util.h @@ -139,7 +139,7 @@ void before_test(void); void after_test(void); /* Test entry point */ -void run_test(int argc, char **argv); +void run_test(int argc, const char **argv); /* Test entry point for fuzzing tests. */ int test_fuzz_one_input(const uint8_t *data, unsigned int size); @@ -372,14 +372,14 @@ int test_attach_i2c(const int port, const uint16_t addr_flags); #define TEST_MAIN() void test_main(void) #define TEST_SUITE(name) void name(void) #else -#define TEST_MAIN() \ - void test_main(void); \ - void run_test(int argc, char **argv) \ - { \ - test_reset(); \ - test_main(); \ - test_print_result(); \ - } \ +#define TEST_MAIN() \ + void test_main(void); \ + void run_test(int argc, const char **argv) \ + { \ + test_reset(); \ + test_main(); \ + test_print_result(); \ + } \ void test_main(void) #define TEST_SUITE(name) TEST_MAIN() #endif diff --git a/include/util.h b/include/util.h index 567bf03866..45accfcf56 100644 --- a/include/util.h +++ b/include/util.h @@ -270,7 +270,8 @@ static inline int cond_went_true(cond_t *c) /* Parse command-line arguments given integer shift value to obtain * offset and size. */ -int parse_offset_size(int argc, char **argv, int shift, int *offset, int *size); +int parse_offset_size(int argc, const char **argv, int shift, int *offset, + int *size); /** * Print binary in hex and ASCII 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; diff --git a/test/aes.c b/test/aes.c index 50160f38a0..51acf51bd3 100644 --- a/test/aes.c +++ b/test/aes.c @@ -568,7 +568,7 @@ static void test_aes_speed(void) ccprintf("AES duration %lld us\n", (long long)(t1.val - t0.val)); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { watchdog_reload(); diff --git a/test/battery_get_params_smart.c b/test/battery_get_params_smart.c index d60be9a5bc..087a0b8d5c 100644 --- a/test/battery_get_params_smart.c +++ b/test/battery_get_params_smart.c @@ -86,7 +86,7 @@ static int test_param_failures(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_param_failures); diff --git a/test/bklight_lid.c b/test/bklight_lid.c index 99167a71a6..992182f50d 100644 --- a/test/bklight_lid.c +++ b/test/bklight_lid.c @@ -95,7 +95,7 @@ static int test_hostcommand(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/bklight_passthru.c b/test/bklight_passthru.c index 170cc734cd..fbddc002ba 100644 --- a/test/bklight_passthru.c +++ b/test/bklight_passthru.c @@ -129,7 +129,7 @@ static int test_hostcommand(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/body_detection.c b/test/body_detection.c index 4a6e5a7c90..489f79ea0f 100644 --- a/test/body_detection.c +++ b/test/body_detection.c @@ -105,7 +105,7 @@ static int test_body_detect(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/button.c b/test/button.c index 9e06246d7f..66aa491a61 100644 --- a/test/button.c +++ b/test/button.c @@ -272,7 +272,7 @@ static void button_test_init(void) button_state[i] = UNCHANGED; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/cec.c b/test/cec.c index 28464dfab0..d03131a4fe 100644 --- a/test/cec.c +++ b/test/cec.c @@ -114,7 +114,7 @@ static int test_queue_overflow(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { queue = &overflow_queue.queue; diff --git a/test/charge_manager.c b/test/charge_manager.c index d1270da0aa..fcf00a5f10 100644 --- a/test/charge_manager.c +++ b/test/charge_manager.c @@ -782,7 +782,7 @@ static int test_unknown_dualrole_capability(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/charge_ramp.c b/test/charge_ramp.c index 6356b44c57..1cc0a90e42 100644 --- a/test/charge_ramp.c +++ b/test/charge_ramp.c @@ -496,7 +496,7 @@ static int test_ramp_limit(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/chipset.c b/test/chipset.c index caad08b52e..c2e915b941 100644 --- a/test/chipset.c +++ b/test/chipset.c @@ -22,7 +22,7 @@ static int test_get_shutdown_reason(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/compile_time_macros.c b/test/compile_time_macros.c index f02fc366a4..326a5cd3bf 100644 --- a/test/compile_time_macros.c +++ b/test/compile_time_macros.c @@ -105,7 +105,7 @@ test_static int test_IS_ARRAY(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/console_edit.c b/test/console_edit.c index 20a553b81a..7133d58c3a 100644 --- a/test/console_edit.c +++ b/test/console_edit.c @@ -16,14 +16,14 @@ static int cmd_1_call_cnt; static int cmd_2_call_cnt; -static int command_test_1(int argc, char **argv) +static int command_test_1(int argc, const char **argv) { cmd_1_call_cnt++; return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(test1, command_test_1, NULL, NULL); -static int command_test_2(int argc, char **argv) +static int command_test_2(int argc, const char **argv) { cmd_2_call_cnt++; return EC_SUCCESS; @@ -314,7 +314,7 @@ static int test_buf_notify_null(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/cortexm_fpu.c b/test/cortexm_fpu.c index a5e944f9d0..153fe3b789 100644 --- a/test/cortexm_fpu.c +++ b/test/cortexm_fpu.c @@ -158,7 +158,7 @@ test_static int test_cortexm_fpu_inexact(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/crc.c b/test/crc.c index b757d117e6..c025dc3e9d 100644 --- a/test/crc.c +++ b/test/crc.c @@ -83,7 +83,7 @@ static int test_cros_crc8(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/debug.c b/test/debug.c index 0a742ff773..604eefa557 100644 --- a/test/debug.c +++ b/test/debug.c @@ -22,7 +22,7 @@ test_static int test_debugger_is_connected(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/entropy.c b/test/entropy.c index 5fdca3969f..ecd0ff9a30 100644 --- a/test/entropy.c +++ b/test/entropy.c @@ -29,7 +29,7 @@ uint32_t log2(int32_t val) return log2_mult * (val1 + val2) / 2; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { const int loopcount = 512; diff --git a/test/extpwr_gpio.c b/test/extpwr_gpio.c index d1f77c9167..ec25eaf5ed 100644 --- a/test/extpwr_gpio.c +++ b/test/extpwr_gpio.c @@ -51,7 +51,7 @@ static int test_hook(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/fan.c b/test/fan.c index a3d53f470c..a781c348d6 100644 --- a/test/fan.c +++ b/test/fan.c @@ -104,7 +104,7 @@ static int test_fan(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_fan); diff --git a/test/flash.c b/test/flash.c index c571c4e05f..c6bc6f711b 100644 --- a/test/flash.c +++ b/test/flash.c @@ -503,7 +503,7 @@ int task_test(void *data) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { msleep(30); /* Wait for TASK_ID_TEST to initialize */ task_wake(TASK_ID_TEST); diff --git a/test/flash_physical.c b/test/flash_physical.c index 9c8277de7c..f59c709e86 100644 --- a/test/flash_physical.c +++ b/test/flash_physical.c @@ -118,7 +118,7 @@ test_static int test_flash_config(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { ccprintf("Running flash physical test\n"); RUN_TEST(test_flash_config); diff --git a/test/flash_write_protect.c b/test/flash_write_protect.c index b8d729331d..8361338186 100644 --- a/test/flash_write_protect.c +++ b/test/flash_write_protect.c @@ -130,7 +130,7 @@ int task_test(void *unused) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { msleep(30); /* Wait for TASK_ID_TEST to initialize */ task_wake(TASK_ID_TEST); @@ -368,7 +368,7 @@ test_static int test_isinf(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/fpsensor.c b/test/fpsensor.c index 1e7015882d..b7f3ee2c5a 100644 --- a/test/fpsensor.c +++ b/test/fpsensor.c @@ -84,7 +84,7 @@ test_static int test_host_command_protocol_info_spi(void) FP_TRANSPORT_TYPE_SPI, &expected_info[FP_TRANSPORT_TYPE_SPI]); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { if (IS_ENABLED(HAS_TASK_FPSENSOR)) { /* TODO(b/171924356): The "emulator" build only builds RO and diff --git a/test/fpsensor_crypto.c b/test/fpsensor_crypto.c index 81bb9428d1..b912acd7d1 100644 --- a/test/fpsensor_crypto.c +++ b/test/fpsensor_crypto.c @@ -749,7 +749,7 @@ test_static int test_command_read_match_secret_unreadable(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_hkdf_expand); RUN_TEST(test_derive_encryption_key_failure_seed_not_set); diff --git a/test/fpsensor_hw.c b/test/fpsensor_hw.c index 306046e2a2..a0eb297b77 100644 --- a/test/fpsensor_hw.c +++ b/test/fpsensor_hw.c @@ -32,7 +32,7 @@ test_static int test_fp_check_hwid(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_fp_check_hwid); test_print_result(); diff --git a/test/fpsensor_state.c b/test/fpsensor_state.c index 3822fe49ab..66936af7ca 100644 --- a/test/fpsensor_state.c +++ b/test/fpsensor_state.c @@ -186,7 +186,7 @@ test_static int test_fp_set_maintenance_mode(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_fp_enc_status_valid_flags); RUN_TEST(test_fp_tpm_seed_not_set); diff --git a/test/gyro_cal.c b/test/gyro_cal.c index 3b55ab86d4..64233086f0 100644 --- a/test/gyro_cal.c +++ b/test/gyro_cal.c @@ -495,7 +495,7 @@ static int test_gyro_cal_remove_bias(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/hooks.c b/test/hooks.c index e47ebf43dc..00731772b0 100644 --- a/test/hooks.c +++ b/test/hooks.c @@ -156,7 +156,7 @@ static int test_repeating_deferred(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/host_command.c b/test/host_command.c index 17637b52de..b50c405aab 100644 --- a/test/host_command.c +++ b/test/host_command.c @@ -306,7 +306,7 @@ static int test_hostcmd_clears_unused_data(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { wait_for_task_started(); test_reset(); diff --git a/test/i2c_bitbang.c b/test/i2c_bitbang.c index 41ae383d78..e77bc3a6fb 100644 --- a/test/i2c_bitbang.c +++ b/test/i2c_bitbang.c @@ -182,7 +182,7 @@ static int test_i2c_write(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/inductive_charging.c b/test/inductive_charging.c index 7892c7fab4..f5a81be4f1 100644 --- a/test/inductive_charging.c +++ b/test/inductive_charging.c @@ -157,7 +157,7 @@ static int test_debounce_charge_done(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/interrupt.c b/test/interrupt.c index ca98309e1f..1e51770189 100644 --- a/test/interrupt.c +++ b/test/interrupt.c @@ -88,7 +88,7 @@ static int test_wait_for_ready(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/irq_locking.c b/test/irq_locking.c index 6d08b1175d..96a615b560 100644 --- a/test/irq_locking.c +++ b/test/irq_locking.c @@ -71,7 +71,7 @@ void before_test(void) interrupt_enable_count = 0; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/is_enabled.c b/test/is_enabled.c index 4813eb4734..943f6bc7fc 100644 --- a/test/is_enabled.c +++ b/test/is_enabled.c @@ -24,7 +24,7 @@ static int test_blank(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/is_enabled_error.c b/test/is_enabled_error.c index 45ab4ed6bd..413f19308b 100644 --- a/test/is_enabled_error.c +++ b/test/is_enabled_error.c @@ -17,7 +17,7 @@ static int test_invalid_value(void) return EC_ERROR_UNKNOWN; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/kasa.c b/test/kasa.c index 6dea8a20e7..a10717be7d 100644 --- a/test/kasa.c +++ b/test/kasa.c @@ -62,7 +62,7 @@ static int test_kasa_calculate(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/kb_8042.c b/test/kb_8042.c index 6ca67b56ab..e660d3753c 100644 --- a/test/kb_8042.c +++ b/test/kb_8042.c @@ -953,7 +953,7 @@ static int test_vivaldi_top_keys(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); wait_for_task_started(); diff --git a/test/kb_mkbp.c b/test/kb_mkbp.c index 7d73479382..3e11559cf5 100644 --- a/test/kb_mkbp.c +++ b/test/kb_mkbp.c @@ -286,7 +286,7 @@ int fifo_underrun(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { ec_int_level = 1; test_reset(); diff --git a/test/kb_scan.c b/test/kb_scan.c index 57d16bc73d..99361c6c8e 100644 --- a/test/kb_scan.c +++ b/test/kb_scan.c @@ -645,7 +645,7 @@ int test_task(void *data) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { msleep(30); /* Wait for TASK_ID_TEST to initialize */ task_wake(TASK_ID_TEST); diff --git a/test/lid_sw.c b/test/lid_sw.c index 8163f74716..320e63fabb 100644 --- a/test/lid_sw.c +++ b/test/lid_sw.c @@ -83,7 +83,7 @@ static int test_debounce(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/lightbar.c b/test/lightbar.c index 3818c30684..ba0fb1b2c4 100644 --- a/test/lightbar.c +++ b/test/lightbar.c @@ -316,7 +316,7 @@ test_static int test_als_lightbar(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { /* Ensure tasks are started before running tests */ usleep(SECOND); diff --git a/test/mag_cal.c b/test/mag_cal.c index 40b71a2d34..7255e7d062 100644 --- a/test/mag_cal.c +++ b/test/mag_cal.c @@ -63,7 +63,7 @@ static int test_mag_cal_computes_bias(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/math_util.c b/test/math_util.c index 0188384b2a..558cb3e40a 100644 --- a/test/math_util.c +++ b/test/math_util.c @@ -120,7 +120,7 @@ test_static int test_temp_conversion(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/motion_angle.c b/test/motion_angle.c index 06a896fbdd..efd00d7226 100644 --- a/test/motion_angle.c +++ b/test/motion_angle.c @@ -88,7 +88,7 @@ static int test_lid_angle_less180(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/motion_angle_tablet.c b/test/motion_angle_tablet.c index 1265a973f7..9ec68eb82c 100644 --- a/test/motion_angle_tablet.c +++ b/test/motion_angle_tablet.c @@ -95,7 +95,7 @@ static int test_lid_angle_less180(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/motion_lid.c b/test/motion_lid.c index a241612c12..2c386b0a91 100644 --- a/test/motion_lid.c +++ b/test/motion_lid.c @@ -315,7 +315,7 @@ static int test_lid_angle(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/motion_sense_fifo.c b/test/motion_sense_fifo.c index f2ad86a951..647c255ba1 100644 --- a/test/motion_sense_fifo.c +++ b/test/motion_sense_fifo.c @@ -427,7 +427,7 @@ void before_test(void) motion_sense_fifo_reset(); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); motion_sense_fifo_init(); diff --git a/test/mpu.c b/test/mpu.c index 0ace4ee710..bac6af09c5 100644 --- a/test/mpu.c +++ b/test/mpu.c @@ -172,7 +172,7 @@ test_static int test_mpu_get_rw_regions(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { enum ec_image cur_image = system_get_image_copy(); diff --git a/test/mutex.c b/test/mutex.c index bd0e033453..0ea8563e2e 100644 --- a/test/mutex.c +++ b/test/mutex.c @@ -110,7 +110,7 @@ int mutex_main_task(void *unused) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { wait_for_task_started(); task_wake(TASK_ID_MTX1); diff --git a/test/newton_fit.c b/test/newton_fit.c index 9648fbfd9a..3a82c56085 100644 --- a/test/newton_fit.c +++ b/test/newton_fit.c @@ -126,7 +126,7 @@ static int test_newton_fit_calculate(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/nvidia_gpu.c b/test/nvidia_gpu.c index d9136cf6c7..22f31be8d0 100644 --- a/test/nvidia_gpu.c +++ b/test/nvidia_gpu.c @@ -201,7 +201,7 @@ static void board_gpu_init(void) } DECLARE_HOOK(HOOK_INIT, board_gpu_init, HOOK_PRIO_DEFAULT); -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { memmap_gpu = (uint8_t *)host_get_memmap(EC_MEMMAP_GPU); diff --git a/test/online_calibration.c b/test/online_calibration.c index 8a9215caa3..1923210117 100644 --- a/test/online_calibration.c +++ b/test/online_calibration.c @@ -227,7 +227,7 @@ void before_test(void) online_calibration_init(); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/online_calibration_spoof.c b/test/online_calibration_spoof.c index 66ef5d01de..64741d0f04 100644 --- a/test/online_calibration_spoof.c +++ b/test/online_calibration_spoof.c @@ -184,7 +184,7 @@ void before_test(void) gyro_cal_initialization_for_test(&gyro_cal_data); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/panic_data.c b/test/panic_data.c index 8b8aa07460..ef902e9141 100644 --- a/test/panic_data.c +++ b/test/panic_data.c @@ -132,7 +132,7 @@ int task_test(void *unused) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); msleep(30); /* Wait for TASK_ID_TEST to initialize */ diff --git a/test/pingpong.c b/test/pingpong.c index 9d3a7ed7af..9150d23755 100644 --- a/test/pingpong.c +++ b/test/pingpong.c @@ -60,7 +60,7 @@ int task_tick(void *data) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { wait_for_task_started(); task_wake(TASK_ID_TICK); diff --git a/test/power_button.c b/test/power_button.c index 5fe9136105..536ea6d595 100644 --- a/test/power_button.c +++ b/test/power_button.c @@ -89,7 +89,7 @@ static int test_debounce(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/printf.c b/test/printf.c index 2a571be54f..ef9229688c 100644 --- a/test/printf.c +++ b/test/printf.c @@ -674,7 +674,7 @@ test_static int test_uint64_to_str(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/queue.c b/test/queue.c index f25906ca6d..ecbfa9dec4 100644 --- a/test/queue.c +++ b/test/queue.c @@ -414,7 +414,7 @@ void before_test(void) queue_init(&test_queue8); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/rgb_keyboard.c b/test/rgb_keyboard.c index 1c6f235e16..9d5d8e6c82 100644 --- a/test/rgb_keyboard.c +++ b/test/rgb_keyboard.c @@ -212,7 +212,7 @@ static int test_rgbkbd_startup(void) return EC_SUCCESS; } -int cc_rgb(int argc, char **argv); +int cc_rgb(int argc, const char **argv); extern enum ec_rgbkbd_demo demo; static int test_rgbkbd_console_command(void) @@ -222,10 +222,10 @@ static int test_rgbkbd_console_command(void) char buf[8]; int i, x, y, r, c; uint8_t offset; - char *argv_demo[] = { "rgbk", "demo", "0" }; - char *argv_gcc[] = { "rgbk", "100" }; - char *argv_color[] = { "rgbk", buf, "0x010203" }; - char *argv_all[] = { "rgbk", "all", "0x010203" }; + const char *argv_demo[] = { "rgbk", "demo", "0" }; + const char *argv_gcc[] = { "rgbk", "100" }; + const char *argv_color[] = { "rgbk", buf, "0x010203" }; + const char *argv_all[] = { "rgbk", "all", "0x010203" }; /* Test 'rgbk demo 0'. */ before_test(); @@ -342,7 +342,7 @@ static int test_rgbkbd_rotate_color(void) static int test_rgbkbd_demo_flow(void) { struct rgb_s copy[ARRAY_SIZE(rgbkbds)][RGB_GRID0_COL * RGB_GRID0_ROW]; - char *argv_demo[] = { "rgbk", "demo", "1" }; + const char *argv_demo[] = { "rgbk", "demo", "1" }; struct rgb_s *p; int argc; struct rgbkbd *ctx; @@ -387,7 +387,7 @@ static int test_rgbkbd_demo_flow(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_rgbkbd_startup); RUN_TEST(test_rgbkbd_console_command); diff --git a/test/rollback.c b/test/rollback.c index 1300e8105b..da2e194202 100644 --- a/test/rollback.c +++ b/test/rollback.c @@ -105,7 +105,7 @@ test_static int test_lock_rollback_region_1(void) return _test_lock_rollback(&rollback_info, 1); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { if (argc < 2) { ccprintf("usage: runtest [region0|region1]\n"); diff --git a/test/rollback_entropy.c b/test/rollback_entropy.c index ce846e80a5..88626e16c2 100644 --- a/test/rollback_entropy.c +++ b/test/rollback_entropy.c @@ -182,7 +182,7 @@ test_static int test_add_entropy(void) return rv; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { ccprintf("Running rollback_entropy test\n"); RUN_TEST(test_add_entropy); diff --git a/test/rsa.c b/test/rsa.c index 73c6ae0bfa..85a616d2ba 100644 --- a/test/rsa.c +++ b/test/rsa.c @@ -23,7 +23,7 @@ static uint32_t rsa_workbuf[3 * RSANUMBYTES / 4]; -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { int good; diff --git a/test/rtc.c b/test/rtc.c index d7f20f831f..c9c5ed2811 100644 --- a/test/rtc.c +++ b/test/rtc.c @@ -95,7 +95,7 @@ static int test_time_conversion(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_time_conversion); diff --git a/test/sbs_charging_v2.c b/test/sbs_charging_v2.c index 2a76229a76..20d06368d0 100644 --- a/test/sbs_charging_v2.c +++ b/test/sbs_charging_v2.c @@ -942,7 +942,7 @@ static int test_battery_sustainer_discharge_idle(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_charge_state); RUN_TEST(test_low_battery); diff --git a/test/scratchpad.c b/test/scratchpad.c index 1bea76f7a1..8bc68de91b 100644 --- a/test/scratchpad.c +++ b/test/scratchpad.c @@ -27,7 +27,7 @@ test_static int test_scratchpad(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_scratchpad); test_print_result(); diff --git a/test/sha256.c b/test/sha256.c index 955167f53a..14557bd97d 100644 --- a/test/sha256.c +++ b/test/sha256.c @@ -168,7 +168,7 @@ static int test_hmac(const uint8_t *key, int key_len, const uint8_t *input, return 1; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { ccprintf("Testing short message (8 bytes)\n"); if (!test_sha256(sha256_8_input, sizeof(sha256_8_input), diff --git a/test/shmalloc.c b/test/shmalloc.c index 31696b2a27..340ca70ce6 100644 --- a/test/shmalloc.c +++ b/test/shmalloc.c @@ -206,7 +206,7 @@ bailout: */ static uint32_t test_map; -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { int index; const int shmem_size = shared_mem_size(); diff --git a/test/static_if.c b/test/static_if.c index f70f7d30c3..63b26bdf25 100644 --- a/test/static_if.c +++ b/test/static_if.c @@ -39,7 +39,7 @@ static int test_static_if_unused_no_fail(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/static_if_error.c b/test/static_if_error.c index 65882b3bbd..e4f2df6eec 100644 --- a/test/static_if_error.c +++ b/test/static_if_error.c @@ -24,7 +24,7 @@ /* This is intended to cause a compilation error. */ TEST_MACRO(CONFIG_FOO) __maybe_unused int foo; -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/stdlib.c b/test/stdlib.c index 7b95a51cce..189581d797 100644 --- a/test/stdlib.c +++ b/test/stdlib.c @@ -494,7 +494,7 @@ static int test_memchr(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/stillness_detector.c b/test/stillness_detector.c index c8a7a22b50..c1c0c23a58 100644 --- a/test/stillness_detector.c +++ b/test/stillness_detector.c @@ -119,7 +119,7 @@ static int test_resets(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/stm32f_rtc.c b/test/stm32f_rtc.c index 77e6e5d256..d820662526 100644 --- a/test/stm32f_rtc.c +++ b/test/stm32f_rtc.c @@ -76,7 +76,7 @@ test_static int test_rtc_match_delay(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/stress.c b/test/stress.c index de53d58a7c..becfffe9cb 100644 --- a/test/stress.c +++ b/test/stress.c @@ -128,7 +128,7 @@ static int test_adc(void) } #endif -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/system.c b/test/system.c index 75757f4237..0fed44900a 100644 --- a/test/system.c +++ b/test/system.c @@ -92,7 +92,7 @@ static void fail_and_clean_up(void) test_fail(); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { uint32_t state = 0; diff --git a/test/system_is_locked.c b/test/system_is_locked.c index f4e5e64159..9c35e206be 100644 --- a/test/system_is_locked.c +++ b/test/system_is_locked.c @@ -90,7 +90,7 @@ int task_test(void *unused) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/thermal.c b/test/thermal.c index c79f18ab2a..6971eea2aa 100644 --- a/test/thermal.c +++ b/test/thermal.c @@ -625,7 +625,7 @@ static int test_thermistor_linear_interpolate(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_init_val); RUN_TEST(test_sensors_can_be_read); diff --git a/test/timer_calib.c b/test/timer_calib.c index fe2d26761d..87eeeb0bb0 100644 --- a/test/timer_calib.c +++ b/test/timer_calib.c @@ -56,7 +56,7 @@ int timer_calib_task(void *data) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { task_wake(TASK_ID_TESTTMR); } diff --git a/test/timer_dos.c b/test/timer_dos.c index c681300102..69b7888c46 100644 --- a/test/timer_dos.c +++ b/test/timer_dos.c @@ -68,7 +68,7 @@ int task_timer(void *seed) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { wait_for_task_started(); task_wake(TASK_ID_TMRD); diff --git a/test/uptime.c b/test/uptime.c index 651628ab7b..d1edc34f5d 100644 --- a/test/uptime.c +++ b/test/uptime.c @@ -62,7 +62,7 @@ test_static int test_host_uptime_info_command_failure(void) return EC_RES_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_common_test.c b/test/usb_common_test.c index 620e061f74..d09ffb9f27 100644 --- a/test/usb_common_test.c +++ b/test/usb_common_test.c @@ -194,7 +194,7 @@ int test_pd_extract_pdo_power(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_pd_get_cc_state); RUN_TEST(test_pd_extract_pdo_power); diff --git a/test/usb_pd.c b/test/usb_pd.c index f68f5d98c1..5183acb991 100644 --- a/test/usb_pd.c +++ b/test/usb_pd.c @@ -911,7 +911,7 @@ static int test_sink(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); init_ports(); diff --git a/test/usb_pd_console.c b/test/usb_pd_console.c index 8587edfe94..80b9978ea3 100644 --- a/test/usb_pd_console.c +++ b/test/usb_pd_console.c @@ -17,8 +17,7 @@ #include "test_util.h" /* Defined in implementation */ -int command_pd(int argc, char **argv); -int remote_flashing(int argc, char **argv); +int command_pd(int argc, const char **argv); static enum debug_level prl_debug_level; static enum debug_level pe_debug_level; @@ -249,7 +248,7 @@ enum pd_cc_states pd_get_task_cc_state(int port) static int test_command_pd_dump(void) { int argc = 3; - char *argv[] = { "pd", "dump", "", 0, 0, 0 }; + const char *argv[] = { "pd", "dump", "", 0, 0, 0 }; char test[2]; sprintf(test, "e"); @@ -277,7 +276,7 @@ static int test_command_pd_dump(void) static int test_command_pd_try_src(void) { int argc = 3; - char *argv[] = { "pd", "trysrc", "2", 0, 0 }; + const char *argv[] = { "pd", "trysrc", "2", 0, 0 }; try_src_override = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -297,7 +296,7 @@ static int test_command_pd_try_src(void) static int test_command_pd_version(void) { int argc = 2; - char *argv[] = { "pd", "version", 0, 0, 0 }; + const char *argv[] = { "pd", "version", 0, 0, 0 }; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -307,7 +306,7 @@ static int test_command_pd_version(void) static int test_command_pd_arg_count(void) { int argc; - char *argv[] = { "pd", "", 0, 0, 0 }; + const char *argv[] = { "pd", "", 0, 0, 0 }; for (argc = 0; argc < 3; argc++) TEST_ASSERT(command_pd(argc, argv) == EC_ERROR_PARAM_COUNT); @@ -318,7 +317,7 @@ static int test_command_pd_arg_count(void) static int test_command_pd_port_num(void) { int argc = 3; - char *argv[10] = { "pd", "0", 0, 0, 0 }; + const char *argv[10] = { "pd", "0", 0, 0, 0 }; char test[2]; sprintf(test, "%d", CONFIG_USB_PD_PORT_MAX_COUNT); @@ -331,7 +330,7 @@ static int test_command_pd_port_num(void) static int test_command_pd_tx(void) { int argc = 3; - char *argv[] = { "pd", "0", "tx", 0, 0 }; + const char *argv[] = { "pd", "0", "tx", 0, 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -344,7 +343,7 @@ static int test_command_pd_tx(void) static int test_command_pd_charger(void) { int argc = 3; - char *argv[] = { "pd", "1", "charger", 0, 0 }; + const char *argv[] = { "pd", "1", "charger", 0, 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -357,7 +356,7 @@ static int test_command_pd_charger(void) static int test_command_pd_dev1(void) { int argc = 4; - char *argv[] = { "pd", "0", "dev", "20", 0 }; + const char *argv[] = { "pd", "0", "dev", "20", 0 }; request = 0; max_volt = 0; @@ -372,7 +371,7 @@ static int test_command_pd_dev1(void) static int test_command_pd_dev2(void) { int argc = 3; - char *argv[] = { "pd", "1", "dev", 0, 0 }; + const char *argv[] = { "pd", "1", "dev", 0, 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -386,7 +385,7 @@ static int test_command_pd_dev2(void) static int test_command_pd_disable(void) { int argc = 3; - char *argv[] = { "pd", "0", "disable", 0, 0 }; + const char *argv[] = { "pd", "0", "disable", 0, 0 }; comm_enable = 1; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -399,7 +398,7 @@ static int test_command_pd_disable(void) static int test_command_pd_enable(void) { int argc = 3; - char *argv[] = { "pd", "1", "enable", 0, 0 }; + const char *argv[] = { "pd", "1", "enable", 0, 0 }; comm_enable = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -412,7 +411,7 @@ static int test_command_pd_enable(void) static int test_command_pd_hard(void) { int argc = 3; - char *argv[] = { "pd", "0", "hard", 0, 0 }; + const char *argv[] = { "pd", "0", "hard", 0, 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -425,7 +424,7 @@ static int test_command_pd_hard(void) static int test_command_pd_soft(void) { int argc = 3; - char *argv[] = { "pd", "0", "soft", 0, 0 }; + const char *argv[] = { "pd", "0", "soft", 0, 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -438,7 +437,7 @@ static int test_command_pd_soft(void) static int test_command_pd_swap1(void) { int argc = 3; - char *argv[] = { "pd", "0", "swap", 0, 0 }; + const char *argv[] = { "pd", "0", "swap", 0, 0 }; TEST_ASSERT(command_pd(argc, argv) == EC_ERROR_PARAM_COUNT); @@ -448,7 +447,7 @@ static int test_command_pd_swap1(void) static int test_command_pd_swap2(void) { int argc = 4; - char *argv[] = { "pd", "0", "swap", "power", 0 }; + const char *argv[] = { "pd", "0", "swap", "power", 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -461,7 +460,7 @@ static int test_command_pd_swap2(void) static int test_command_pd_swap3(void) { int argc = 4; - char *argv[] = { "pd", "1", "swap", "data", 0 }; + const char *argv[] = { "pd", "1", "swap", "data", 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -474,7 +473,7 @@ static int test_command_pd_swap3(void) static int test_command_pd_swap4(void) { int argc = 4; - char *argv[] = { "pd", "0", "swap", "vconn", 0 }; + const char *argv[] = { "pd", "0", "swap", "vconn", 0 }; request = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -487,7 +486,7 @@ static int test_command_pd_swap4(void) static int test_command_pd_swap5(void) { int argc = 4; - char *argv[] = { "pd", "0", "swap", "xyz", 0 }; + const char *argv[] = { "pd", "0", "swap", "xyz", 0 }; TEST_ASSERT(command_pd(argc, argv) == EC_ERROR_PARAM3); @@ -497,7 +496,7 @@ static int test_command_pd_swap5(void) static int test_command_pd_dualrole0(void) { int argc = 3; - char *argv[] = { "pd", "0", "dualrole", 0, 0 }; + const char *argv[] = { "pd", "0", "dualrole", 0, 0 }; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -507,7 +506,7 @@ static int test_command_pd_dualrole0(void) static int test_command_pd_dualrole1(void) { int argc = 4; - char *argv[] = { "pd", "0", "dualrole", "on", 0 }; + const char *argv[] = { "pd", "0", "dualrole", "on", 0 }; dr_state = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -520,7 +519,7 @@ static int test_command_pd_dualrole1(void) static int test_command_pd_dualrole2(void) { int argc = 4; - char *argv[] = { "pd", "0", "dualrole", "off", 0 }; + const char *argv[] = { "pd", "0", "dualrole", "off", 0 }; dr_state = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -533,7 +532,7 @@ static int test_command_pd_dualrole2(void) static int test_command_pd_dualrole3(void) { int argc = 4; - char *argv[] = { "pd", "0", "dualrole", "freeze", 0 }; + const char *argv[] = { "pd", "0", "dualrole", "freeze", 0 }; dr_state = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -546,7 +545,7 @@ static int test_command_pd_dualrole3(void) static int test_command_pd_dualrole4(void) { int argc = 4; - char *argv[] = { "pd", "0", "dualrole", "sink", 0 }; + const char *argv[] = { "pd", "0", "dualrole", "sink", 0 }; dr_state = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -559,7 +558,7 @@ static int test_command_pd_dualrole4(void) static int test_command_pd_dualrole5(void) { int argc = 4; - char *argv[] = { "pd", "0", "dualrole", "source", 0 }; + const char *argv[] = { "pd", "0", "dualrole", "source", 0 }; dr_state = 0; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -572,7 +571,7 @@ static int test_command_pd_dualrole5(void) static int test_command_pd_state(void) { int argc = 3; - char *argv[] = { "pd", "0", "state", 0, 0 }; + const char *argv[] = { "pd", "0", "state", 0, 0 }; pd_get_polarity_called = false; pd_comm_is_enabled_called = false; @@ -601,7 +600,7 @@ static int test_command_pd_state(void) static int test_command_pd_srccaps(void) { int argc = 3; - char *argv[] = { "pd", "0", "srccaps", 0, 0 }; + const char *argv[] = { "pd", "0", "srccaps", 0, 0 }; pd_srccaps_dump_called = false; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -613,7 +612,7 @@ static int test_command_pd_srccaps(void) static int test_command_pd_timer(void) { int argc = 3; - char *argv[] = { "pd", "0", "timer", 0, 0 }; + const char *argv[] = { "pd", "0", "timer", 0, 0 }; pd_timer_dump_called = false; TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS); @@ -622,7 +621,7 @@ static int test_command_pd_timer(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_pd_int.c b/test/usb_pd_int.c index c0caa67bcb..d61d45a73f 100644 --- a/test/usb_pd_int.c +++ b/test/usb_pd_int.c @@ -97,7 +97,7 @@ void before_test(void) pd_set_suspend(PORT0, 0); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { /* Let tasks settle down */ task_wait_event(MINUTE); diff --git a/test/usb_pd_pdo_fixed_test.c b/test/usb_pd_pdo_fixed_test.c index ad247c3ba2..6bc537ab84 100644 --- a/test/usb_pd_pdo_fixed_test.c +++ b/test/usb_pd_pdo_fixed_test.c @@ -39,7 +39,7 @@ test_static int test_pd_find_pdo_index(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_pd_find_pdo_index); diff --git a/test/usb_pd_timer.c b/test/usb_pd_timer.c index 91e1360fb1..705da03f96 100644 --- a/test/usb_pd_timer.c +++ b/test/usb_pd_timer.c @@ -207,7 +207,7 @@ int test_pd_timers(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_pd_timers_init); RUN_TEST(test_pd_timers_bit_ops); diff --git a/test/usb_pe_drp.c b/test/usb_pe_drp.c index 894d825b87..a224a0fddd 100644 --- a/test/usb_pe_drp.c +++ b/test/usb_pe_drp.c @@ -317,7 +317,7 @@ test_static int test_interrupting_pr_swap(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_pe_drp_noextended.c b/test/usb_pe_drp_noextended.c index 2e5593fea3..38920fdf98 100644 --- a/test/usb_pe_drp_noextended.c +++ b/test/usb_pe_drp_noextended.c @@ -33,7 +33,7 @@ void before_test(void) mock_tc_port_reset(); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_pe_drp_old.c b/test/usb_pe_drp_old.c index c45c9b7033..a74d8c5d06 100644 --- a/test/usb_pe_drp_old.c +++ b/test/usb_pe_drp_old.c @@ -413,7 +413,7 @@ static int test_send_caps_error(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_pe_drp_old_noextended.c b/test/usb_pe_drp_old_noextended.c index ddf6fda897..f0ec34c7d0 100644 --- a/test/usb_pe_drp_old_noextended.c +++ b/test/usb_pe_drp_old_noextended.c @@ -342,7 +342,7 @@ static int test_send_caps_error(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_ppc.c b/test/usb_ppc.c index 4d37992348..a50498a443 100644 --- a/test/usb_ppc.c +++ b/test/usb_ppc.c @@ -168,7 +168,7 @@ static int test_ppc_is_vbus_present(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_prl.c b/test/usb_prl.c index 1b4f78a0fe..d6f144bab1 100644 --- a/test/usb_prl.c +++ b/test/usb_prl.c @@ -166,7 +166,7 @@ void after_test(void) enable_prl(PORT0, 0); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_receive_control_msg); RUN_TEST(test_send_control_msg); diff --git a/test/usb_prl_noextended.c b/test/usb_prl_noextended.c index c0b5d8696d..3450c012af 100644 --- a/test/usb_prl_noextended.c +++ b/test/usb_prl_noextended.c @@ -1301,7 +1301,7 @@ void before_test(void) cycle_through_state_machine(PORT0, 10, MSEC); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_prl_old.c b/test/usb_prl_old.c index c0b5d8696d..3450c012af 100644 --- a/test/usb_prl_old.c +++ b/test/usb_prl_old.c @@ -1301,7 +1301,7 @@ void before_test(void) cycle_through_state_machine(PORT0, 10, MSEC); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_sm_framework_h3.c b/test/usb_sm_framework_h3.c index 09904dfb8f..1afb822516 100644 --- a/test/usb_sm_framework_h3.c +++ b/test/usb_sm_framework_h3.c @@ -1161,7 +1161,7 @@ int test_task(void *u) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); #if defined(TEST_USB_SM_FRAMEWORK_H3) diff --git a/test/usb_tcpmv2_compliance.c b/test/usb_tcpmv2_compliance.c index e0288feb18..249d62d38b 100644 --- a/test/usb_tcpmv2_compliance.c +++ b/test/usb_tcpmv2_compliance.c @@ -30,7 +30,7 @@ void before_test(void) tc_try_src_override(TRY_SRC_OVERRIDE_OFF); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_typec_ctvpd.c b/test/usb_typec_ctvpd.c index 2c7404ec9b..23cc39d3c8 100644 --- a/test/usb_typec_ctvpd.c +++ b/test/usb_typec_ctvpd.c @@ -1488,7 +1488,7 @@ static int test_ctvpd_behavior_case6(void) } #endif -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c index 47599d7975..0b36fa9e8a 100644 --- a/test/usb_typec_drp_acc_trysrc.c +++ b/test/usb_typec_drp_acc_trysrc.c @@ -814,7 +814,7 @@ void before_test(void) mock_tcpc.should_print_call = true; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/utils.c b/test/utils.c index 042e3a1ac0..58899fe7c2 100644 --- a/test/utils.c +++ b/test/utils.c @@ -379,7 +379,7 @@ test_static int test_parse_bool(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/utils_str.c b/test/utils_str.c index 7607b071f2..16fcfc4484 100644 --- a/test/utils_str.c +++ b/test/utils_str.c @@ -104,7 +104,7 @@ static int test_strzcpy(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/vboot.c b/test/vboot.c index 7dab08ac05..f11f8fabaf 100644 --- a/test/vboot.c +++ b/test/vboot.c @@ -131,7 +131,7 @@ static int test_vboot(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { test_reset(); diff --git a/test/version.c b/test/version.c index ad7571d5f6..a44029f459 100644 --- a/test/version.c +++ b/test/version.c @@ -139,7 +139,7 @@ static int test_image_unknown(void) return EC_SUCCESS; } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { RUN_TEST(test_version); RUN_TEST(test_fwid); diff --git a/third_party/boringssl/test/x25519.c b/third_party/boringssl/test/x25519.c index dac8795b63..4ab7578768 100644 --- a/third_party/boringssl/test/x25519.c +++ b/third_party/boringssl/test/x25519.c @@ -180,7 +180,7 @@ static void test_x25519_speed(void) ccprintf("X25519 duration %lld us\n", (long long)(t1.val - t0.val)); } -void run_test(int argc, char **argv) +void run_test(int argc, const char **argv) { watchdog_reload(); /* do not check speed, just as a benchmark */ diff --git a/zephyr/mock/include/mock/power.h b/zephyr/mock/include/mock/power.h index 8c6f4235c2..c1549e18cd 100644 --- a/zephyr/mock/include/mock/power.h +++ b/zephyr/mock/include/mock/power.h @@ -13,7 +13,7 @@ DECLARE_FAKE_VALUE_FUNC(enum power_state, power_handle_state, enum power_state); DECLARE_FAKE_VOID_FUNC(chipset_force_shutdown, enum chipset_shutdown_reason); DECLARE_FAKE_VOID_FUNC(chipset_power_on); -DECLARE_FAKE_VALUE_FUNC(int, command_power, int, char **); +DECLARE_FAKE_VALUE_FUNC(int, command_power, int, const char **); enum power_state power_handle_state_custom_fake(enum power_state state); @@ -21,6 +21,6 @@ void chipset_force_shutdown_custom_fake(enum chipset_shutdown_reason reason); void chipset_power_on_custom_fake(void); -int command_power_custom_fake(int argc, char **argv); +int command_power_custom_fake(int argc, const char **argv); #endif /* ZEPHYR_TEST_MOCK_POWER_H */ diff --git a/zephyr/mock/power.c b/zephyr/mock/power.c index dbea522cab..8e5ae2b120 100644 --- a/zephyr/mock/power.c +++ b/zephyr/mock/power.c @@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(mock_power); DEFINE_FAKE_VALUE_FUNC(enum power_state, power_handle_state, enum power_state); DEFINE_FAKE_VOID_FUNC(chipset_force_shutdown, enum chipset_shutdown_reason); DEFINE_FAKE_VOID_FUNC(chipset_power_on); -DEFINE_FAKE_VALUE_FUNC(int, command_power, int, char **); +DEFINE_FAKE_VALUE_FUNC(int, command_power, int, const char **); #define MOCK_POWER_LIST(FAKE) \ { \ @@ -115,7 +115,7 @@ static const char *const state_name[] = { "ON", }; -int command_power_custom_fake(int argc, char **argv) +int command_power_custom_fake(int argc, const char **argv) { int v, req; diff --git a/zephyr/shim/core/cortex-m/irq_command.c b/zephyr/shim/core/cortex-m/irq_command.c index 911aeae946..f88e8e9a5a 100644 --- a/zephyr/shim/core/cortex-m/irq_command.c +++ b/zephyr/shim/core/cortex-m/irq_command.c @@ -21,7 +21,7 @@ void sys_trace_isr_enter_user(int nested_interrupts) irq_count[irq]++; } -static int command_irq(int argc, char **argv) +static int command_irq(int argc, const char **argv) { ARG_UNUSED(argc); ARG_UNUSED(argv); diff --git a/zephyr/shim/include/zephyr_console_shim.h b/zephyr/shim/include/zephyr_console_shim.h index 87bee7498f..1a0d754439 100644 --- a/zephyr/shim/include/zephyr_console_shim.h +++ b/zephyr/shim/include/zephyr_console_shim.h @@ -10,7 +10,7 @@ struct zephyr_console_command { /* Handler for the command. argv[0] will be the command name. */ - int (*handler)(int argc, char **argv); + int (*handler)(int argc, const char **argv); #ifdef CONFIG_SHELL_HELP /* Description of args */ const char *argdesc; @@ -36,7 +36,7 @@ struct zephyr_console_command { * Return: the return value from the handler. */ int zshim_run_ec_console_command(const struct zephyr_console_command *command, - size_t argc, char **argv); + size_t argc, const char **argv); /* Internal wrappers for DECLARE_CONSOLE_COMMAND_* macros. */ #define _ZEPHYR_SHELL_COMMAND_SHIM_2(NAME, ROUTINE_ID, ARGDESC, HELP, \ @@ -45,7 +45,7 @@ int zshim_run_ec_console_command(const struct zephyr_console_command *command, .handler = ROUTINE_ID, _HELP_ARGS(ARGDESC, HELP) \ }; \ static int WRAPPER_ID(const struct shell *shell, size_t argc, \ - char **argv) \ + const char **argv) \ { \ return zshim_run_ec_console_command(&ENTRY_ID, argc, argv); \ } \ 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"); |