From bb266fc26fc05d4ab22de6ad7bce5b477c9f9140 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Mon, 11 Mar 2019 15:57:52 -0700 Subject: common: replace 1 << digits, with BIT(digits) Requested for linux integration, use BIT instead of 1 << First step replace bit operation with operand containing only digits. Fix an error in motion_lid try to set bit 31 of a signed integer. BUG=None BRANCH=None TEST=compile Change-Id: Ie843611f2f68e241f0f40d4067f7ade726951d29 Signed-off-by: Gwendal Grignou Reviewed-on: https://chromium-review.googlesource.com/1518659 Reviewed-by: Daisuke Nojiri --- board/samus/panel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'board/samus/panel.c') diff --git a/board/samus/panel.c b/board/samus/panel.c index 970197b9c8..961cb6fafe 100644 --- a/board/samus/panel.c +++ b/board/samus/panel.c @@ -35,7 +35,7 @@ #define LP8555_REG_CURRENT_MAXCURR_50MA 0x07 #define LP8555_REG_STEP 0x15 #define LP8555_REG_STEP_STEP_0MS (0 << 0) -#define LP8555_REG_STEP_STEP_8MS (1 << 0) +#define LP8555_REG_STEP_STEP_8MS BIT(0) #define LP8555_REG_STEP_STEP_16MS (2 << 0) #define LP8555_REG_STEP_STEP_24MS (3 << 0) #define LP8555_REG_STEP_STEP_28MS (4 << 0) @@ -43,7 +43,7 @@ #define LP8555_REG_STEP_STEP_100MS (6 << 0) #define LP8555_REG_STEP_STEP_200MS (7 << 0) #define LP8555_REG_STEP_PWM_IN_HYST_NONE (0 << 3) -#define LP8555_REG_STEP_PWM_IN_HYST_1LSB (1 << 3) +#define LP8555_REG_STEP_PWM_IN_HYST_1LSB BIT(3) #define LP8555_REG_STEP_PWM_IN_HYST_2LSB (2 << 3) #define LP8555_REG_STEP_PWM_IN_HYST_4LSB (3 << 3) #define LP8555_REG_STEP_PWM_IN_HYST_8LSB (4 << 3) @@ -51,7 +51,7 @@ #define LP8555_REG_STEP_PWM_IN_HYST_32LSB (6 << 3) #define LP8555_REG_STEP_PWM_IN_HYST_64LSB (7 << 3) #define LP8555_REG_STEP_SMOOTH_NONE (0 << 6) -#define LP8555_REG_STEP_SMOOTH_LIGHT (1 << 6) +#define LP8555_REG_STEP_SMOOTH_LIGHT BIT(6) #define LP8555_REG_STEP_SMOOTH_MEDIUM (2 << 6) #define LP8555_REG_STEP_SMOOTH_HEAVY (3 << 6) -- cgit v1.2.1