diff options
author | Vic Yang <victoryang@chromium.org> | 2014-05-19 15:03:27 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-21 20:32:17 +0000 |
commit | ffac23c0ea1bd4ff4568f5bd709a98f912b833a7 (patch) | |
tree | 362dd0ba205731aa07be97dd35b44b237799b23b /common/keyboard_mkbp.c | |
parent | 478361de694b1fb45abf3c38dafbbf7fd1aa5f71 (diff) | |
download | chrome-ec-ffac23c0ea1bd4ff4568f5bd709a98f912b833a7.tar.gz |
Add cprints() and ccprints()
Our code base contains a lot of debug messages in this pattern:
CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n")
The strings are taking up spaces in the EC binaries, so let's refactor
this by adding cprints() and ccprints().
cprints() is just like cprintf(), except that it adds the brackets
and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...)
This saves us hundreds of bytes in EC binaries.
BUG=chromium:374575
TEST=Build and check flash size
BRANCH=None
Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200490
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/keyboard_mkbp.c')
-rw-r--r-- | common/keyboard_mkbp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c index 4b1f479d5f..7e9f6f5c45 100644 --- a/common/keyboard_mkbp.c +++ b/common/keyboard_mkbp.c @@ -22,7 +22,7 @@ /* Console output macros */ #define CPUTS(outstr) cputs(CC_KEYBOARD, outstr) -#define CPRINTF(format, args...) cprintf(CC_KEYBOARD, format, ## args) +#define CPRINTS(format, args...) cprints(CC_KEYBOARD, format, ## args) /* * Keyboard FIFO depth. This needs to be big enough not to overflow if a @@ -111,7 +111,7 @@ void keyboard_clear_buffer(void) { int i; - CPRINTF("[clearing keyboard fifo]\n"); + CPRINTS("clearing keyboard fifo"); kb_fifo_start = 0; kb_fifo_end = 0; @@ -132,7 +132,7 @@ test_mockable int keyboard_fifo_add(const uint8_t *buffp) return EC_SUCCESS; if (kb_fifo_entries >= config.fifo_max_depth) { - CPRINTF("[%T KB FIFO depth %d reached]\n", + CPRINTS("KB FIFO depth %d reached", config.fifo_max_depth); ret = EC_ERROR_OVERFLOW; goto kb_fifo_push_done; |