summaryrefslogtreecommitdiff
path: root/common/port80.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 14:38:48 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-28 18:59:06 +0000
commit76f525aad7c47d8db5180d5bb7608038485f031e (patch)
treeff98a5f7b9a992d38d22634221ab8b0a98b11e84 /common/port80.c
parentec09cba4a3e5fc9a3bc4f35c63abb32a1585400e (diff)
downloadchrome-ec-76f525aad7c47d8db5180d5bb7608038485f031e.tar.gz
common/port80.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I5f7228e81f3e97f61d5ed59d7abdee482e48c3e1 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729700 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'common/port80.c')
-rw-r--r--common/port80.c27
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)
{