diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2021-08-29 17:13:30 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-17 00:18:32 +0000 |
commit | 6e6387a2f17bfb13df86b74b8c3394ff0dc485c8 (patch) | |
tree | bec85666ef3b6bff8ace5fb5a93b007b051d58f7 | |
parent | d00425c2f90c81ee63bcab09269e83af13ed33c8 (diff) | |
download | chrome-ec-6e6387a2f17bfb13df86b74b8c3394ff0dc485c8.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.
Conflict: only add the BIT macro in compile_time_macros.h.
BUG=None
BRANCH=rammus
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>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3128747
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Craig Hesling <hesling@chromium.org>
Reviewed-by: JuHyun Kim <jkim@invensense.com>
Tested-by: JuHyun Kim <jkim@invensense.com>
-rw-r--r-- | include/compile_time_macros.h | 6 |
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 */ |