summaryrefslogtreecommitdiff
path: root/common/acpi.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-05-19 15:03:27 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-21 20:32:17 +0000
commitffac23c0ea1bd4ff4568f5bd709a98f912b833a7 (patch)
tree362dd0ba205731aa07be97dd35b44b237799b23b /common/acpi.c
parent478361de694b1fb45abf3c38dafbbf7fd1aa5f71 (diff)
downloadchrome-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/acpi.c')
-rw-r--r--common/acpi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/acpi.c b/common/acpi.c
index eed20fdbe0..88c0a8351e 100644
--- a/common/acpi.c
+++ b/common/acpi.c
@@ -14,6 +14,7 @@
/* Console output macros */
#define CPUTS(outstr) cputs(CC_LPC, outstr)
#define CPRINTF(format, args...) cprintf(CC_LPC, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_LPC, format, ## args)
static uint8_t acpi_cmd; /* Last received ACPI command */
static uint8_t acpi_addr; /* First byte of data after ACPI command */
@@ -86,7 +87,7 @@ int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *resultptr)
break;
#endif
default:
- CPRINTF("[%T ACPI read 0x%02x (ignored)]\n", acpi_addr);
+ CPRINTS("ACPI read 0x%02x (ignored)", acpi_addr);
break;
}
@@ -144,7 +145,7 @@ int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *resultptr)
break;
#endif
default:
- CPRINTF("[%T ACPI write 0x%02x = 0x%02x (ignored)]\n",
+ CPRINTS("ACPI write 0x%02x = 0x%02x (ignored)",
acpi_addr, data);
break;
}
@@ -154,7 +155,7 @@ int acpi_ap_to_ec(int is_cmd, uint8_t value, uint8_t *resultptr)
} else if (acpi_cmd == EC_CMD_ACPI_QUERY_EVENT && !acpi_data_count) {
/* Clear and return the lowest host event */
int evt_index = lpc_query_host_event_state();
- CPRINTF("[%T ACPI query = %d]\n", evt_index);
+ CPRINTS("ACPI query = %d", evt_index);
*resultptr = evt_index;
retval = 1;
#endif