summaryrefslogtreecommitdiff
path: root/common/console_output.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-04-06 10:18:22 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-06 23:21:31 +0000
commit077f7c8b4797218c7be52736b46e56a49c567765 (patch)
tree05d59c69c818bbcfaab2683163056d846757d86b /common/console_output.c
parent1f7961e69334ac0b34ba4c55d88ca4088060d72f (diff)
downloadchrome-ec-077f7c8b4797218c7be52736b46e56a49c567765.tar.gz
ensure all console channels are displaying properly
If the number of console channels is greater than 32 (the bit size of the channel mask), the overflowing ones are silently masked. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=add one channel and see the build failing on the assert. Change-Id: I1793b22990be85882d80aae44503bba62358fbd2 Reviewed-on: https://chromium-review.googlesource.com/264062 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/console_output.c')
-rw-r--r--common/console_output.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/console_output.c b/common/console_output.c
index 492375e71e..32042c5b51 100644
--- a/common/console_output.c
+++ b/common/console_output.c
@@ -66,6 +66,8 @@ static const char * const channel_names[] = {
"hook",
};
BUILD_ASSERT(ARRAY_SIZE(channel_names) == CC_CHANNEL_COUNT);
+/* ensure that we are not silently masking additional channels */
+BUILD_ASSERT(CC_CHANNEL_COUNT <= 8*sizeof(uint32_t));
/*****************************************************************************/
/* Channel-based console output */