diff options
Diffstat (limited to 'common/port80.c')
-rw-r--r-- | common/port80.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/common/port80.c b/common/port80.c index 231181cad8..c7c9d714ff 100644 --- a/common/port80.c +++ b/common/port80.c @@ -15,7 +15,7 @@ #include "timer.h" #include "util.h" -#define CPRINTF(format, args...) cprintf(CC_PORT80, format, ## args) +#define CPRINTF(format, args...) cprintf(CC_PORT80, format, ##args) #ifdef CONFIG_PORT80_4_BYTE typedef uint32_t port80_code_t; @@ -23,7 +23,7 @@ typedef uint32_t port80_code_t; typedef uint16_t port80_code_t; #endif static port80_code_t history[CONFIG_PORT80_HISTORY_LEN]; -static int writes; /* Number of port 80 writes so far */ +static int writes; /* Number of port 80 writes so far */ static uint16_t last_boot; /* Last code from previous boot */ static int scroll; @@ -54,14 +54,15 @@ void port_80_write(int data) * developers to help debug BIOS progress by tracing port80 messages. */ if (print_in_int) - CPRINTF("%c[%pT Port 80: 0x%02x]", - scroll ? '\n' : '\r', PRINTF_TIMESTAMP_NOW, data); + CPRINTF("%c[%pT Port 80: 0x%02x]", scroll ? '\n' : '\r', + PRINTF_TIMESTAMP_NOW, data); hook_call_deferred(&port80_dump_buffer_data, 4 * SECOND); /* Save current port80 code if system is resetting */ if (data == PORT_80_EVENT_RESET && writes) { - port80_code_t prev = history[(writes-1) % ARRAY_SIZE(history)]; + port80_code_t prev = + history[(writes - 1) % ARRAY_SIZE(history)]; /* * last_boot only reports 8-bit codes. @@ -154,8 +155,7 @@ static int command_port80(int argc, char **argv) port80_dump_buffer(); return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(port80, command_port80, - "[scroll | intprint | flush]", +DECLARE_CONSOLE_COMMAND(port80, command_port80, "[scroll | intprint | flush]", "Print port80 writes or toggle port80 scrolling"); enum ec_status port80_last_boot(struct host_cmd_handler_args *args) @@ -187,24 +187,23 @@ static enum ec_status port80_command_read(struct host_cmd_handler_args *args) } else if (p->subcmd == EC_PORT80_READ_BUFFER) { /* do not allow bad offset or size */ if (offset >= ARRAY_SIZE(history) || entries == 0 || - entries > args->response_max) + entries > args->response_max) return EC_RES_INVALID_PARAM; for (i = 0; i < entries; i++) { - uint16_t e = history[(i + offset) % - ARRAY_SIZE(history)]; + uint16_t e = + history[(i + offset) % ARRAY_SIZE(history)]; rsp->data.codes[i] = e; } - args->response_size = entries*sizeof(uint16_t); + args->response_size = entries * sizeof(uint16_t); return EC_RES_SUCCESS; } return EC_RES_INVALID_PARAM; } -DECLARE_HOST_COMMAND(EC_CMD_PORT80_READ, - port80_command_read, - EC_VER_MASK(0) | EC_VER_MASK(1)); +DECLARE_HOST_COMMAND(EC_CMD_PORT80_READ, port80_command_read, + EC_VER_MASK(0) | EC_VER_MASK(1)); static void port80_log_resume(void) { |