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 /chip/mec1322/dma.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 'chip/mec1322/dma.c')
-rw-r--r-- | chip/mec1322/dma.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chip/mec1322/dma.c b/chip/mec1322/dma.c index b354fea2a4..34617c92bc 100644 --- a/chip/mec1322/dma.c +++ b/chip/mec1322/dma.c @@ -27,8 +27,8 @@ void dma_disable(enum dma_channel channel) { mec1322_dma_chan_t *chan = dma_get_channel(channel); - if (chan->ctrl & (1 << 0)) - chan->ctrl &= ~(1 << 0); + if (chan->ctrl & BIT(0)) + chan->ctrl &= ~BIT(0); if (chan->act == 1) chan->act = 0; @@ -42,9 +42,9 @@ void dma_disable_all(void) for (ch = 0; ch < MEC1322_DMAC_COUNT; ch++) { mec1322_dma_chan_t *chan = dma_get_channel(ch); /* Abort any current transfer. */ - chan->ctrl |= (1 << 25); + chan->ctrl |= BIT(25); /* Disable the channel. */ - chan->ctrl &= ~(1 << 0); + chan->ctrl &= ~BIT(0); chan->act = 0; } @@ -69,8 +69,8 @@ static void prepare_channel(mec1322_dma_chan_t *chan, unsigned count, { int xfer_size = (flags >> 20) & 0x7; - if (chan->ctrl & (1 << 0)) - chan->ctrl &= ~(1 << 0); + if (chan->ctrl & BIT(0)) + chan->ctrl &= ~BIT(0); chan->act |= 0x1; chan->dev = (uint32_t)periph; |