diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2019-05-08 17:34:37 +0900 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-14 20:13:42 -0700 |
commit | 932e8400412f5c9d0cbad467c3f486036727620b (patch) | |
tree | 87f31a80ab299271640be1d25fecdadb8135c486 /common/queue.c | |
parent | ac8a13329b0b321daeb87f6afb79c163beb21372 (diff) | |
download | chrome-ec-932e8400412f5c9d0cbad467c3f486036727620b.tar.gz |
queue.h: Check at compile time if queue size is power of 2
Replace the runtime assertion with a compile time one, saves a bit
of space (~64 bytes on many boards), and warn users earlier of
potential issues.
BRANCH=none
BUG=none
TEST=make buildall -j
Change-Id: I7df70b7166dd447a8b1dd8e10710c8bc7ab213e3
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1600943
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'common/queue.c')
-rw-r--r-- | common/queue.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/common/queue.c b/common/queue.c index 584d0fbdfa..780bd41d3b 100644 --- a/common/queue.c +++ b/common/queue.c @@ -18,7 +18,6 @@ struct queue_policy const queue_policy_null = { void queue_init(struct queue const *q) { - ASSERT(POWER_OF_TWO(q->buffer_units)); ASSERT(q->policy); ASSERT(q->policy->add); ASSERT(q->policy->remove); |