summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-10-14 20:57:27 +0000
committerCommit Bot <commit-bot@chromium.org>2021-10-15 23:40:38 +0000
commit09e3123257d708a59e3ae110f628ecbae74b49db (patch)
tree71d96fd934d4b3290e62222d69e7f079e6c5b8d7
parent0888fe2d3e01b379ca8024d09f24fd89b3d49acf (diff)
downloadchrome-ec-09e3123257d708a59e3ae110f628ecbae74b49db.tar.gz
tree: Make all console commands static
Almost all of the console commands were already static. This change makes all of them static for consistency. BRANCH=none BUG=b:172020503 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0ac46358b6fbafa65504c648ce4de0365cdbf723 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3224372 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--baseboard/kukui/charger_mt6370.c2
-rw-r--r--board/elm/board.c3
-rw-r--r--board/nucleo-f411re/board.c2
-rw-r--r--chip/mt_scp/mt8183/clock.c2
-rw-r--r--common/fpsensor/fpsensor.c10
-rw-r--r--common/led_pwm.c2
-rw-r--r--common/temp_sensor.c17
-rw-r--r--common/thermal.c2
-rw-r--r--common/timer.c2
-rw-r--r--core/cortex-m/task.c2
-rw-r--r--core/cortex-m0/task.c2
-rw-r--r--core/host/task.c2
-rw-r--r--core/minute-ia/task.c2
-rw-r--r--core/nds32/task.c2
-rw-r--r--core/riscv-rv32i/task.c2
-rw-r--r--include/console.h7
-rw-r--r--include/temp_sensor.h7
17 files changed, 35 insertions, 33 deletions
diff --git a/baseboard/kukui/charger_mt6370.c b/baseboard/kukui/charger_mt6370.c
index 327b567db6..99e51aead2 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);
}
-int command_jc(int argc, char **argv)
+static int command_jc(int argc, char **argv)
{
static int prev_jc_temp;
int jc_temp;
diff --git a/board/elm/board.c b/board/elm/board.c
index d62ff8afae..f4f1e3be2e 100644
--- a/board/elm/board.c
+++ b/board/elm/board.c
@@ -244,7 +244,7 @@ void board_reset_pd_mcu(void)
hook_call_deferred(&deferred_reset_pd_mcu_data, 10*MSEC);
}
-int command_pd_reset(int argc, char **argv)
+static int command_pd_reset(int argc, char **argv)
{
board_reset_pd_mcu();
return EC_SUCCESS;
@@ -529,4 +529,3 @@ uint16_t tcpc_get_alert_status(void)
{
return gpio_get_level(GPIO_PD_MCU_INT) ? PD_STATUS_TCPC_ALERT_0 : 0;
}
-
diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c
index a177a793ab..074507e039 100644
--- a/board/nucleo-f411re/board.c
+++ b/board/nucleo-f411re/board.c
@@ -112,7 +112,7 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
#ifdef CONFIG_DMA_HELP
#include "dma.h"
-int command_dma_help(int argc, char **argv)
+static int command_dma_help(int argc, char **argv)
{
dma_dump(STM32_DMA2_STREAM0);
dma_test(STM32_DMA2_STREAM0);
diff --git a/chip/mt_scp/mt8183/clock.c b/chip/mt_scp/mt8183/clock.c
index 3029a00a01..066e269579 100644
--- a/chip/mt_scp/mt8183/clock.c
+++ b/chip/mt_scp/mt8183/clock.c
@@ -355,7 +355,7 @@ void clock_fast_wakeup_irq(void)
}
/* Console command */
-int command_ulposc(int argc, char *argv[])
+static int command_ulposc(int argc, char *argv[])
{
if (argc > 1 && !strncmp(argv[1], "cal", 3)) {
scp_calibrate_ulposc(0, ULPOSC1_CLOCK_MHZ);
diff --git a/common/fpsensor/fpsensor.c b/common/fpsensor/fpsensor.c
index 25010c7db8..8d4f88c8eb 100644
--- a/common/fpsensor/fpsensor.c
+++ b/common/fpsensor/fpsensor.c
@@ -762,7 +762,7 @@ static enum ec_error_list fp_console_action(uint32_t mode)
return EC_ERROR_TIMEOUT;
}
-int command_fpcapture(int argc, char **argv)
+static int command_fpcapture(int argc, char **argv)
{
int capture_type = FP_CAPTURE_SIMPLE_IMAGE;
uint32_t mode;
@@ -795,7 +795,7 @@ DECLARE_CONSOLE_COMMAND_FLAGS(fpcapture, command_fpcapture, NULL,
"Capture fingerprint in PGM format",
CMD_FLAG_RESTRICTED);
-int command_fpenroll(int argc, char **argv)
+static int command_fpenroll(int argc, char **argv)
{
enum ec_error_list rc;
int percent = 0;
@@ -837,7 +837,7 @@ DECLARE_CONSOLE_COMMAND_FLAGS(fpenroll, command_fpenroll, NULL,
CMD_FLAG_RESTRICTED);
-int command_fpmatch(int argc, char **argv)
+static int command_fpmatch(int argc, char **argv)
{
enum ec_error_list rc = fp_console_action(FP_MODE_MATCH);
uint32_t event = atomic_clear(&fp_events);
@@ -855,7 +855,7 @@ int command_fpmatch(int argc, char **argv)
DECLARE_CONSOLE_COMMAND(fpmatch, command_fpmatch, NULL,
"Run match algorithm against finger");
-int command_fpclear(int argc, char **argv)
+static int command_fpclear(int argc, char **argv)
{
/*
* We intentionally run this on the fp_task so that we use the
@@ -873,7 +873,7 @@ int command_fpclear(int argc, char **argv)
DECLARE_CONSOLE_COMMAND(fpclear, command_fpclear, NULL,
"Clear fingerprint sensor context");
-int command_fpmaintenance(int argc, char **argv)
+static int command_fpmaintenance(int argc, char **argv)
{
#ifdef HAVE_FP_PRIVATE_DRIVER
return fp_maintenance();
diff --git a/common/led_pwm.c b/common/led_pwm.c
index cc946ba522..45c9dbf60a 100644
--- a/common/led_pwm.c
+++ b/common/led_pwm.c
@@ -258,7 +258,7 @@ static void update_leds(void)
DECLARE_HOOK(HOOK_TICK, update_leds, HOOK_PRIO_DEFAULT);
#ifdef CONFIG_CMD_LEDTEST
-int command_ledtest(int argc, char **argv)
+static int command_ledtest(int argc, char **argv)
{
int enable;
int pwm_led_id;
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index 5d30750ba5..219e28254c 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -102,11 +102,7 @@ static void temp_sensor_init(void)
}
DECLARE_HOOK(HOOK_INIT, temp_sensor_init, HOOK_PRIO_DEFAULT);
-/*****************************************************************************/
-/* Console commands */
-
-#ifdef CONFIG_CMD_TEMP_SENSOR
-int console_command_temps(int argc, char **argv)
+int print_temps(void)
{
int t, i;
int rv, rv1 = EC_SUCCESS;
@@ -144,7 +140,16 @@ int console_command_temps(int argc, char **argv)
return rv1;
}
-DECLARE_CONSOLE_COMMAND(temps, console_command_temps,
+
+/*****************************************************************************/
+/* Console commands */
+
+#ifdef CONFIG_CMD_TEMP_SENSOR
+static int command_temps(int argc, char **argv)
+{
+ return print_temps();
+}
+DECLARE_CONSOLE_COMMAND(temps, command_temps,
NULL,
"Print temp sensors");
#endif
diff --git a/common/thermal.c b/common/thermal.c
index e9750931be..50047c96bb 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -178,7 +178,7 @@ static void thermal_control(void)
/* Print temperature sensor values before shutting down AP */
if (IS_ENABLED(CONFIG_CMD_TEMP_SENSOR)) {
- console_command_temps(1, NULL);
+ print_temps();
cflush();
}
diff --git a/common/timer.c b/common/timer.c
index 019753f4db..d4504f19b7 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -405,7 +405,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(gettime, command_get_time,
#endif
#ifdef CONFIG_CMD_TIMERINFO
-int command_timer_info(int argc, char **argv)
+static int command_timer_info(int argc, char **argv)
{
timer_print_info();
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index bf0eb5b397..b86750bd67 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -965,7 +965,7 @@ void task_print_list(void)
}
}
-int command_task_info(int argc, char **argv)
+static int command_task_info(int argc, char **argv)
{
#ifdef CONFIG_TASK_PROFILING
int total = 0;
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index ba40b667b6..ee7f9fb8e6 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -580,7 +580,7 @@ void task_print_list(void)
}
}
-int command_task_info(int argc, char **argv)
+static int command_task_info(int argc, char **argv)
{
#ifdef CONFIG_TASK_PROFILING
int total = 0;
diff --git a/core/host/task.c b/core/host/task.c
index be7ed3c579..70ce3e006f 100644
--- a/core/host/task.c
+++ b/core/host/task.c
@@ -316,7 +316,7 @@ void task_print_list(void)
}
}
-int command_task_info(int argc, char **argv)
+static int command_task_info(int argc, char **argv)
{
task_print_list();
diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c
index fdbe37485b..dc0d72fb23 100644
--- a/core/minute-ia/task.c
+++ b/core/minute-ia/task.c
@@ -549,7 +549,7 @@ void task_print_list(void)
}
}
-int command_task_info(int argc, char **argv)
+static int command_task_info(int argc, char **argv)
{
task_print_list();
diff --git a/core/nds32/task.c b/core/nds32/task.c
index edacb7975e..5b4fe86876 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -687,7 +687,7 @@ void task_print_list(void)
}
}
-int command_task_info(int argc, char **argv)
+static int command_task_info(int argc, char **argv)
{
#ifdef CONFIG_TASK_PROFILING
int total = 0;
diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c
index 558177e969..ef1595eaeb 100644
--- a/core/riscv-rv32i/task.c
+++ b/core/riscv-rv32i/task.c
@@ -620,7 +620,7 @@ void task_print_list(void)
}
}
-int command_task_info(int argc, char **argv)
+static int command_task_info(int argc, char **argv)
{
#ifdef CONFIG_TASK_PROFILING
unsigned int total = 0;
diff --git a/include/console.h b/include/console.h
index 5bb1f2541f..34dba9c5ed 100644
--- a/include/console.h
+++ b/include/console.h
@@ -221,11 +221,11 @@ void console_has_input(void);
*/
#if !defined(HAS_TASK_CONSOLE) && !defined(CONFIG_ZEPHYR)
#define DECLARE_CONSOLE_COMMAND(NAME, ROUTINE, ARGDESC, HELP) \
- int (ROUTINE)(int argc, char **argv) __attribute__((unused))
+ static int (ROUTINE)(int argc, char **argv) __attribute__((unused))
#define DECLARE_SAFE_CONSOLE_COMMAND(NAME, ROUTINE, ARGDESC, HELP) \
- int (ROUTINE)(int argc, char **argv) __attribute__((unused))
+ static int (ROUTINE)(int argc, char **argv) __attribute__((unused))
#define DECLARE_CONSOLE_COMMAND_FLAGS(NAME, ROUTINE, ARGDESC, HELP, FLAGS) \
- int (ROUTINE)(int argc, char **argv) __attribute__((unused))
+ static int (ROUTINE)(int argc, char **argv) __attribute__((unused))
#elif defined(HAS_TASK_CONSOLE)
/* We always provde help args, but we may discard them to save space. */
@@ -247,6 +247,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 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/temp_sensor.h b/include/temp_sensor.h
index 50a174193f..cf04760e67 100644
--- a/include/temp_sensor.h
+++ b/include/temp_sensor.h
@@ -68,13 +68,10 @@ extern const struct temp_sensor_t temp_sensors[];
int temp_sensor_read(enum temp_sensor_id id, int *temp_ptr);
/**
- * Console command to print temperature sensor values
- *
- * @param argc argument count (Set argc = 1)
- * @param argv argument vector (Set argv = NULL)
+ * Print all temperature sensor values.
*
* @return EC_SUCCESS, or non-zero if error.
*/
-int console_command_temps(int argc, char **argv);
+int print_temps(void);
#endif /* __CROS_EC_TEMP_SENSOR_H */