summaryrefslogtreecommitdiff
path: root/include/compile_time_macros.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-03-11 11:02:08 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-03-26 04:42:53 -0700
commit8c6e95303832f7d445b415f1a1c0b0e34487ab2f (patch)
treebd767446f9220482361fd95ca301be16c834ea53 /include/compile_time_macros.h
parent8cc25cc66ef058238548152d71e35044276f00f6 (diff)
downloadchrome-ec-8c6e95303832f7d445b415f1a1c0b0e34487ab2f.tar.gz
common: Add BIT macro
As requested for integration in kernel mfd subsystem, use BIT(...) instead of (1 << ... ). Add the macros, apply just to ec_commands.h for now. BUG=None BRANCH=None TEST=Compile Change-Id: I8509f1e8dc966799c3c4f0269b15f1ccc4138c07 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1518658 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/compile_time_macros.h')
-rw-r--r--include/compile_time_macros.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/compile_time_macros.h b/include/compile_time_macros.h
index bf133d60f4..30a3e901b3 100644
--- a/include/compile_time_macros.h
+++ b/include/compile_time_macros.h
@@ -35,4 +35,10 @@
#define member_size(type, member) sizeof(((type *)0)->member)
+/*
+ * Bit operation macros.
+ */
+#define BIT(nr) (1UL << (nr))
+#define BIT_ULL(nr) (1ULL << (nr))
+
#endif /* __CROS_EC_COMPILE_TIME_MACROS_H */