diff options
author | Denis Brockus <dbrockus@google.com> | 2021-08-10 16:55:44 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-12 21:23:44 +0000 |
commit | ca8cbd49df8ff4d245b59b2a24941f4db4ff52e4 (patch) | |
tree | 86023a74c29bf509b9abd03ee73f8b9149851e4d /zephyr/shim/src | |
parent | d75d4d6edc58d19862975b798c88804e55872218 (diff) | |
download | chrome-ec-ca8cbd49df8ff4d245b59b2a24941f4db4ff52e4.tar.gz |
zephyr: shim: cleanup comments and code in console.c
BUG=none
BRANCH=none
TEST=none
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Iab1f8a1274e94491590697ad1efffdca46cb8e4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088235
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/shim/src')
-rw-r--r-- | zephyr/shim/src/console.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c index 39176a45e0..17797fb991 100644 --- a/zephyr/shim/src/console.c +++ b/zephyr/shim/src/console.c @@ -42,7 +42,8 @@ static void uart_rx_handle(const struct device *dev) /* Put `rd_len` bytes on the ring buffer */ ring_buf_put_finish(&rx_buffer, rd_len); } else { - /* There's no room on the ring buffer, throw away 1 + /* + * There's no room on the ring buffer, throw away 1 * byte. */ rd_len = uart_fifo_read(dev, &scratch, 1); @@ -67,7 +68,8 @@ static void shell_uninit_callback(const struct shell *shell, int res) /* Set the new callback */ uart_irq_callback_user_data_set(dev, uart_callback, NULL); - /* Disable TX interrupts. We don't actually use TX but for some + /* + * Disable TX interrupts. We don't actually use TX but for some * reason none of this works without this line. */ uart_irq_tx_disable(dev); @@ -267,13 +269,14 @@ static void handle_sprintf_rv(int rv, size_t *len) static void zephyr_print(const char *buff, size_t size) { - /* shell_* functions can not be used in ISRs so use printk instead. + /* + * shell_* functions can not be used in ISRs so use printk instead. * Also, console_buf_notify_chars uses a mutex, which may not be * locked in ISRs. */ - if (k_is_in_isr() || shell_zephyr->ctx->state != SHELL_STATE_ACTIVE) + if (k_is_in_isr() || shell_zephyr->ctx->state != SHELL_STATE_ACTIVE) { printk("%s", buff); - else { + } else { /* * On some platforms, shell_* functions are not as fast * as printk and they need the added speed to avoid |