diff options
author | Yi Chou <yich@google.com> | 2022-11-07 03:18:30 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-07 05:02:13 +0000 |
commit | 9fd0cedfd82a0fe3068af096d224eb6f48ee3c31 (patch) | |
tree | 6da926c30ef57482dda162069a705e7986655860 /common | |
parent | 39caf07089611bcd1ac01ac33907c77f415b93c5 (diff) | |
download | chrome-ec-9fd0cedfd82a0fe3068af096d224eb6f48ee3c31.tar.gz |
Revert "test: unit test uart_printf.c"
This reverts commit 365143e8cea63db9b1016ff336cad37463899c88.
Reason for revert: b/257859791, the original CL might break the
firmware-zephyr-cov-cq
Original change's description:
> test: unit test uart_printf.c
>
> Add unit tests to get uart_printf.c to 100% coverage.
>
> BRANCH=none
> BUG=none
> TEST=twister
>
> Signed-off-by: Yuval Peress <peress@google.com>
> Change-Id: I2fdbea71a7048a2187c599052bf7180a97ee3ad2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4004509
> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Bug: none
Change-Id: I6e064a7878d08e29906d73d33113b90befd9fba2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4003486
Tested-by: Yi Chou <yich@google.com>
Reviewed-by: Yuval Peress <peress@google.com>
Reviewed-by: Chung-sheng Wu <chungsheng@google.com>
Commit-Queue: Yuval Peress <peress@google.com>
Code-Coverage: Yuval Peress <peress@google.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/uart_printf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/common/uart_printf.c b/common/uart_printf.c index a4fecf5c73..01fd1353d2 100644 --- a/common/uart_printf.c +++ b/common/uart_printf.c @@ -31,10 +31,9 @@ int uart_putc(int c) int uart_puts(const char *outstr) { /* Put all characters in the output buffer */ - for (; *outstr != '\0'; ++outstr) { - if (__tx_char(NULL, *outstr) != 0) { + while (*outstr) { + if (__tx_char(NULL, *outstr++) != 0) break; - } } uart_tx_start(); @@ -49,9 +48,8 @@ int uart_put(const char *out, int len) /* Put all characters in the output buffer */ for (written = 0; written < len; written++) { - if (__tx_char(NULL, *out++) != 0) { + if (__tx_char(NULL, *out++) != 0) break; - } } uart_tx_start(); @@ -65,9 +63,8 @@ int uart_put_raw(const char *out, int len) /* Put all characters in the output buffer */ for (written = 0; written < len; written++) { - if (uart_tx_char_raw(NULL, *out++) != 0) { + if (uart_tx_char_raw(NULL, *out++) != 0) break; - } } uart_tx_start(); |