diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-10-13 23:50:06 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-15 21:50:03 +0000 |
commit | f0fcad109d75ff48459d2cc7e4c3dde9e691af3f (patch) | |
tree | 526c8c2f9d5128db26311a32789b8c605494b535 | |
parent | 833baa422d10783531c3293afc8b7ce94a1c846a (diff) | |
download | chrome-ec-f0fcad109d75ff48459d2cc7e4c3dde9e691af3f.tar.gz |
tree: Make all host commands static
Almost all of the host 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: I8330e85e6d64a039f08d7620eed1fe897f436567
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3221786
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | chip/it83xx/spi.c | 9 | ||||
-rw-r--r-- | common/i2c_peripheral.c | 8 | ||||
-rw-r--r-- | common/keyboard_backlight.c | 6 | ||||
-rw-r--r-- | common/panic_output.c | 3 | ||||
-rw-r--r-- | common/port80.c | 2 | ||||
-rw-r--r-- | common/pstore_commands.c | 7 | ||||
-rw-r--r-- | common/rwsig.c | 4 | ||||
-rw-r--r-- | common/system.c | 4 | ||||
-rw-r--r-- | common/temp_sensor.c | 3 | ||||
-rw-r--r-- | driver/battery/bq20z453.c | 3 | ||||
-rw-r--r-- | driver/temp_sensor/tmp006.c | 6 | ||||
-rw-r--r-- | include/host_command.h | 4 | ||||
-rw-r--r-- | include/i2c.h | 8 |
13 files changed, 39 insertions, 28 deletions
diff --git a/chip/it83xx/spi.c b/chip/it83xx/spi.c index 63f8e4247c..8e417ebcbe 100644 --- a/chip/it83xx/spi.c +++ b/chip/it83xx/spi.c @@ -381,7 +381,7 @@ void emmc_ap_jump_to_bl(enum gpio_signal signal) #endif /* Get protocol information */ -enum ec_status spi_get_protocol_info(struct host_cmd_handler_args *args) +static enum ec_status _spi_get_protocol_info(struct host_cmd_handler_args *args) { struct ec_response_get_protocol_info *r = args->response; @@ -396,5 +396,10 @@ enum ec_status spi_get_protocol_info(struct host_cmd_handler_args *args) return EC_SUCCESS; } DECLARE_HOST_COMMAND(EC_CMD_GET_PROTOCOL_INFO, - spi_get_protocol_info, + _spi_get_protocol_info, EC_VER_MASK(0)); + +enum ec_status spi_get_protocol_info(struct host_cmd_handler_args *args) +{ + return _spi_get_protocol_info(args); +} diff --git a/common/i2c_peripheral.c b/common/i2c_peripheral.c index 20a4b4b0ae..ebc7167f8d 100644 --- a/common/i2c_peripheral.c +++ b/common/i2c_peripheral.c @@ -9,7 +9,13 @@ #include "i2c.h" #include "util.h" -enum ec_status i2c_get_protocol_info(struct host_cmd_handler_args *args) +/** + * Command handler to get host command protocol information + * + * @param args: host command handler arguments + * @return EC_SUCCESS + */ +static enum ec_status i2c_get_protocol_info(struct host_cmd_handler_args *args) { struct ec_response_get_protocol_info *r = args->response; diff --git a/common/keyboard_backlight.c b/common/keyboard_backlight.c index 82312e0776..d3d9fbe6d3 100644 --- a/common/keyboard_backlight.c +++ b/common/keyboard_backlight.c @@ -132,7 +132,8 @@ DECLARE_CONSOLE_COMMAND(kblight, cc_kblight, "percent", "Get/set keyboard backlight"); -enum ec_status hc_get_keyboard_backlight(struct host_cmd_handler_args *args) +static enum ec_status +hc_get_keyboard_backlight(struct host_cmd_handler_args *args) { struct ec_response_pwm_get_keyboard_backlight *r = args->response; @@ -146,7 +147,8 @@ DECLARE_HOST_COMMAND(EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT, hc_get_keyboard_backlight, EC_VER_MASK(0)); -enum ec_status hc_set_keyboard_backlight(struct host_cmd_handler_args *args) +static enum ec_status +hc_set_keyboard_backlight(struct host_cmd_handler_args *args) { const struct ec_params_pwm_set_keyboard_backlight *p = args->params; diff --git a/common/panic_output.c b/common/panic_output.c index 8e2342612d..03c500528e 100644 --- a/common/panic_output.c +++ b/common/panic_output.c @@ -421,7 +421,8 @@ DECLARE_CONSOLE_COMMAND(panicinfo, command_panicinfo, /*****************************************************************************/ /* Host commands */ -enum ec_status host_command_panic_info(struct host_cmd_handler_args *args) +static enum ec_status +host_command_panic_info(struct host_cmd_handler_args *args) { uint32_t pdata_size = get_panic_data_size(); uintptr_t pdata_start = get_panic_data_start(); diff --git a/common/port80.c b/common/port80.c index ab1f112112..5d4a6b12ac 100644 --- a/common/port80.c +++ b/common/port80.c @@ -168,7 +168,7 @@ enum ec_status port80_last_boot(struct host_cmd_handler_args *args) return EC_RES_SUCCESS; } -enum ec_status port80_command_read(struct host_cmd_handler_args *args) +static enum ec_status port80_command_read(struct host_cmd_handler_args *args) { const struct ec_params_port80_read *p = args->params; uint32_t offset = p->read_buffer.offset; diff --git a/common/pstore_commands.c b/common/pstore_commands.c index 52270cd1cf..469af6a054 100644 --- a/common/pstore_commands.c +++ b/common/pstore_commands.c @@ -10,7 +10,8 @@ #include "host_command.h" #include "util.h" -enum ec_status pstore_command_get_info(struct host_cmd_handler_args *args) +static enum ec_status +pstore_command_get_info(struct host_cmd_handler_args *args) { struct ec_response_pstore_info *r = args->response; @@ -26,7 +27,7 @@ DECLARE_HOST_COMMAND(EC_CMD_PSTORE_INFO, pstore_command_get_info, EC_VER_MASK(0)); -enum ec_status pstore_command_read(struct host_cmd_handler_args *args) +static enum ec_status pstore_command_read(struct host_cmd_handler_args *args) { const struct ec_params_pstore_read *p = args->params; char *dest = args->response; @@ -63,7 +64,7 @@ DECLARE_HOST_COMMAND(EC_CMD_PSTORE_READ, pstore_command_read, EC_VER_MASK(0)); -enum ec_status pstore_command_write(struct host_cmd_handler_args *args) +static enum ec_status pstore_command_write(struct host_cmd_handler_args *args) { const struct ec_params_pstore_write *p = args->params; diff --git a/common/rwsig.c b/common/rwsig.c index 418a69c1a1..676c66d79b 100644 --- a/common/rwsig.c +++ b/common/rwsig.c @@ -298,7 +298,7 @@ exit: task_wait_event(-1); } -enum ec_status rwsig_cmd_action(struct host_cmd_handler_args *args) +static enum ec_status rwsig_cmd_action(struct host_cmd_handler_args *args) { const struct ec_params_rwsig_action *p = args->params; @@ -320,7 +320,7 @@ DECLARE_HOST_COMMAND(EC_CMD_RWSIG_ACTION, EC_VER_MASK(0)); #else /* !HAS_TASK_RWSIG */ -enum ec_status rwsig_cmd_check_status(struct host_cmd_handler_args *args) +static enum ec_status rwsig_cmd_check_status(struct host_cmd_handler_args *args) { struct ec_response_rwsig_check_status *r = args->response; diff --git a/common/system.c b/common/system.c index 09d508bda5..5e18170b59 100644 --- a/common/system.c +++ b/common/system.c @@ -1691,7 +1691,7 @@ DECLARE_HOST_COMMAND(EC_CMD_GET_CHIP_INFO, host_command_get_chip_info, EC_VER_MASK(0)); -enum ec_status +static enum ec_status host_command_get_board_version(struct host_cmd_handler_args *args) { struct ec_response_board_version *r = args->response; @@ -1712,7 +1712,7 @@ DECLARE_HOST_COMMAND(EC_CMD_GET_BOARD_VERSION, host_command_get_board_version, EC_VER_MASK(0)); -enum ec_status host_command_reboot(struct host_cmd_handler_args *args) +static enum ec_status host_command_reboot(struct host_cmd_handler_args *args) { struct ec_params_reboot_ec p; diff --git a/common/temp_sensor.c b/common/temp_sensor.c index 69d440a6d5..5d30750ba5 100644 --- a/common/temp_sensor.c +++ b/common/temp_sensor.c @@ -152,7 +152,8 @@ DECLARE_CONSOLE_COMMAND(temps, console_command_temps, /*****************************************************************************/ /* Host commands */ -enum ec_status temp_sensor_command_get_info(struct host_cmd_handler_args *args) +static enum ec_status +temp_sensor_command_get_info(struct host_cmd_handler_args *args) { const struct ec_params_temp_sensor_get_info *p = args->params; struct ec_response_temp_sensor_get_info *r = args->response; diff --git a/driver/battery/bq20z453.c b/driver/battery/bq20z453.c index 3cd16e8b8f..2eea73742b 100644 --- a/driver/battery/bq20z453.c +++ b/driver/battery/bq20z453.c @@ -18,7 +18,8 @@ static void cutoff(void) } DECLARE_DEFERRED(cutoff); -enum ec_status battery_command_cut_off(struct host_cmd_handler_args *args) +static enum ec_status +battery_command_cut_off(struct host_cmd_handler_args *args) { /* * Queue battery cutoff. This must be deferred so we can send the diff --git a/driver/temp_sensor/tmp006.c b/driver/temp_sensor/tmp006.c index e4794ccc4a..22f4402747 100644 --- a/driver/temp_sensor/tmp006.c +++ b/driver/temp_sensor/tmp006.c @@ -264,7 +264,7 @@ int tmp006_get_val(int idx, int *temp_ptr) /*****************************************************************************/ /* Host commands */ -enum ec_status tmp006_get_calibration(struct host_cmd_handler_args *args) +static enum ec_status tmp006_get_calibration(struct host_cmd_handler_args *args) { const struct ec_params_tmp006_get_calibration *p = args->params; struct ec_response_tmp006_get_calibration_v1 *r1 = args->response; @@ -299,7 +299,7 @@ DECLARE_HOST_COMMAND(EC_CMD_TMP006_GET_CALIBRATION, tmp006_get_calibration, EC_VER_MASK(1)); -enum ec_status tmp006_set_calibration(struct host_cmd_handler_args *args) +static enum ec_status tmp006_set_calibration(struct host_cmd_handler_args *args) { const struct ec_params_tmp006_set_calibration_v1 *p1 = args->params; struct tmp006_data_t *tdata; @@ -333,7 +333,7 @@ DECLARE_HOST_COMMAND(EC_CMD_TMP006_SET_CALIBRATION, tmp006_set_calibration, EC_VER_MASK(1)); -enum ec_status tmp006_get_raw(struct host_cmd_handler_args *args) +static enum ec_status tmp006_get_raw(struct host_cmd_handler_args *args) { const struct ec_params_tmp006_get_raw *p = args->params; struct ec_response_tmp006_get_raw *r = args->response; diff --git a/include/host_command.h b/include/host_command.h index ccf86214aa..8a66776ce9 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -270,6 +270,7 @@ struct host_command *zephyr_find_host_command(int command); * commands starting at offset 0x0000 */ #define DECLARE_HOST_COMMAND(command, routine, version_mask) \ + static enum ec_status(routine)(struct host_cmd_handler_args *args); \ const struct host_command __keep __no_sanitize_address \ EXPAND(0x0000, command) \ __attribute__((section(".rodata.hcmds."EXPANDSTR(0x0000, command)))) \ @@ -280,6 +281,7 @@ struct host_command *zephyr_find_host_command(int command); * commands starting at offset EC_CMD_BOARD_SPECIFIC_BASE, */ #define DECLARE_PRIVATE_HOST_COMMAND(command, routine, version_mask) \ + static enum ec_status(routine)(struct host_cmd_handler_args *args); \ const struct host_command __keep __no_sanitize_address \ EXPAND(EC_CMD_BOARD_SPECIFIC_BASE, command) \ __attribute__((section(".rodata.hcmds."\ @@ -288,7 +290,7 @@ struct host_command *zephyr_find_host_command(int command); version_mask} #else /* !CONFIG_ZEPHYR && !HAS_TASK_HOSTCMD */ #define DECLARE_HOST_COMMAND(command, routine, version_mask) \ - enum ec_status (routine)(struct host_cmd_handler_args *args) \ + static enum ec_status (routine)(struct host_cmd_handler_args *args) \ __attribute__((unused)) #define DECLARE_PRIVATE_HOST_COMMAND(command, routine, version_mask) \ diff --git a/include/i2c.h b/include/i2c.h index 6de438f4e0..57996289dd 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -477,14 +477,6 @@ int i2c_write_block(const int port, int i2c_port_to_controller(int port); /** - * Command handler to get host command protocol information - * - * @param args: host command handler arguments - * @return EC_SUCCESS - */ -enum ec_status i2c_get_protocol_info(struct host_cmd_handler_args *args); - -/** * Callbacks processing received data and response * * i2c_data_received will be called when a peripheral finishes receiving data |