summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-03-16 11:19:51 +0000
committerCommit Bot <commit-bot@chromium.org>2022-03-16 22:50:24 +0000
commit22a187557d35440ea0d4d30d06ea320e44810e99 (patch)
tree458eb6f6c11a62fbf4e46cc74f7539cdbdd66a19
parent5908f8785d80e858c4fa95bb8c660bf7254982d5 (diff)
downloadchrome-ec-22a187557d35440ea0d4d30d06ea320e44810e99.tar.gz
zephyr: avoid duplicate IN_RANGE macro
This has been added to Zephyr, avoid redefining it. BRANCH=none BUG=none TEST=zmake -j2 configure -b brya Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Cq-Depend: chromium:3519923 Change-Id: I7992c643b82648240ccbfdb77014a6bcc8034f5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3528400 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--include/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h
index a1c1abb514..ed1961e887 100644
--- a/include/util.h
+++ b/include/util.h
@@ -15,6 +15,9 @@
#include "builtin/assert.h" /* For ASSERT(). */
#include <stdbool.h>
#include <stddef.h>
+#ifdef CONFIG_ZEPHYR
+#include <sys/util.h>
+#endif
#ifdef __cplusplus
extern "C" {
@@ -73,7 +76,9 @@ extern "C" {
#define POWER_OF_TWO(x) ((x) && !((x) & ((x) - 1)))
/* Macro to check if the value is in range */
+#ifndef CONFIG_ZEPHYR
#define IN_RANGE(x, min, max) ((x) >= (min) && (x) < (max))
+#endif
/*
* macros for integer division with various rounding variants