diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2019-03-11 15:57:52 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-26 04:42:55 -0700 |
commit | bb266fc26fc05d4ab22de6ad7bce5b477c9f9140 (patch) | |
tree | f6ada087f62246c3a9547e649ac8846b0ed6d5ab /board/cr50/rdd.c | |
parent | 0bfc511527cf2aebfa163c63a1d028419ca0b0c3 (diff) | |
download | chrome-ec-bb266fc26fc05d4ab22de6ad7bce5b477c9f9140.tar.gz |
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 <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1518659
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/cr50/rdd.c')
-rw-r--r-- | board/cr50/rdd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c index 8128d1b24c..876ba5dcef 100644 --- a/board/cr50/rdd.c +++ b/board/cr50/rdd.c @@ -34,15 +34,15 @@ enum ccd_block_flags { * UARTs. Disabling these can be helpful if the AP or EC is doing * something which creates an interrupt storm on these ports. */ - CCD_BLOCK_AP_UART = (1 << 0), - CCD_BLOCK_EC_UART = (1 << 1), + CCD_BLOCK_AP_UART = BIT(0), + CCD_BLOCK_EC_UART = BIT(1), /* * Any ports shared with servo. Disabling these will stop CCD from * interfering with servo, in the case where both CCD and servo is * connected but servo isn't properly detected. */ - CCD_BLOCK_SERVO_SHARED = (1 << 2) + CCD_BLOCK_SERVO_SHARED = BIT(2) }; /* Which UARTs are blocked by console command */ @@ -128,28 +128,28 @@ enum ccd_state_flag { /* Flags for individual devices/ports */ /* AP UART is enabled. RX-only, unless TX is also enabled. */ - CCD_ENABLE_UART_AP = (1 << 0), + CCD_ENABLE_UART_AP = BIT(0), /* AP UART transmit is enabled. Requires AP UART enabled. */ - CCD_ENABLE_UART_AP_TX = (1 << 1), + CCD_ENABLE_UART_AP_TX = BIT(1), /* EC UART is enabled. RX-only, unless TX is also enabled. */ - CCD_ENABLE_UART_EC = (1 << 2), + CCD_ENABLE_UART_EC = BIT(2), /* EC UART transmit is enabled. Requires EC UART enabled. */ - CCD_ENABLE_UART_EC_TX = (1 << 3), + CCD_ENABLE_UART_EC_TX = BIT(3), /* * EC UART bit-banging is enabled. Requires EC UART enabled, and * blocks EC UART transmit. */ - CCD_ENABLE_UART_EC_BITBANG = (1 << 4), + CCD_ENABLE_UART_EC_BITBANG = BIT(4), /* I2C port is enabled */ - CCD_ENABLE_I2C = (1 << 5), + CCD_ENABLE_I2C = BIT(5), /* SPI port is enabled for AP and/or EC flash */ - CCD_ENABLE_SPI = (1 << 6), + CCD_ENABLE_SPI = BIT(6), }; int console_is_restricted(void) |