diff options
author | Patrick Georgi <pgeorgi@google.com> | 2019-09-09 22:28:28 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-09-10 12:19:50 +0000 |
commit | 4523df8fee2c8e045b47c5c73fe6f1760516a555 (patch) | |
tree | 3b96445711a43ecd6ad4c8935a06d6545a4f873a | |
parent | ff1cf395c685a9bd9455224051ae5be241dc898a (diff) | |
download | chrome-ec-4523df8fee2c8e045b47c5c73fe6f1760516a555.tar.gz |
chip/stm/i2c-stm32f4: Remove constant conditionals
rv_start is effectively constant (and 0) after goto xfer_exit, so the
conditionals aren't needed.
Found by Coverity Scan #157505
BUG=none
BRANCH=none
TEST=none
Change-Id: Id7d2445615ae0f1230a9245f0baf9b9ea1d9a80a
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1793582
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | chip/stm32/i2c-stm32f4.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/chip/stm32/i2c-stm32f4.c b/chip/stm32/i2c-stm32f4.c index 1fe95d1722..aa4a363e54 100644 --- a/chip/stm32/i2c-stm32f4.c +++ b/chip/stm32/i2c-stm32f4.c @@ -458,15 +458,13 @@ static int chip_fmpi2c_xfer(const int port, const uint16_t slave_addr_8bit, goto xfer_exit; STM32_FMPI2C_CR1(port) |= FMPI2C_CR1_RXDMAEN; - if (!rv_start) { - rv = task_wait_event_mask( - TASK_EVENT_I2C_COMPLETION(port), - DMA_TRANSFER_TIMEOUT_US); - if (rv & TASK_EVENT_I2C_COMPLETION(port)) - rv = EC_SUCCESS; - else - rv = EC_ERROR_TIMEOUT; - } + rv = task_wait_event_mask( + TASK_EVENT_I2C_COMPLETION(port), + DMA_TRANSFER_TIMEOUT_US); + if (rv & TASK_EVENT_I2C_COMPLETION(port)) + rv = EC_SUCCESS; + else + rv = EC_ERROR_TIMEOUT; dma_disable(dma->channel); dma_disable_tc_interrupt(dma->channel); @@ -476,9 +474,6 @@ static int chip_fmpi2c_xfer(const int port, const uint16_t slave_addr_8bit, rv = wait_fmpi2c_isr(port, FMPI2C_ISR_STOPF); STM32_FMPI2C_CR1(port) &= ~FMPI2C_CR1_RXDMAEN; - - if (rv_start) - rv = rv_start; } xfer_exit: |