summaryrefslogtreecommitdiff
path: root/chip/mchp
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-05-16 17:10:54 +0200
committerchrome-bot <chrome-bot@chromium.org>2018-05-17 19:34:47 -0700
commit6a705c51e5069e99b6336f0e7b2c4ded1c633a92 (patch)
treedf0b5838585d66ca600bdb91cbecd9620672abcc /chip/mchp
parent2ca73981809debeeb3112c09b939de6b56514b5d (diff)
downloadchrome-ec-6a705c51e5069e99b6336f0e7b2c4ded1c633a92.tar.gz
chip/mchp: Surround conditional code with braces
Lest it does something stupid. gcc 8.1 checks for such style/semantic discrepancies... yay, I guess? BUG=b:65441143 BRANCH=none TEST=builds with gcc 8.1 Change-Id: I26f1b4dc5cda5c248c14eab2d1c0e5b9c22f4c49 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1061877 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com>
Diffstat (limited to 'chip/mchp')
-rw-r--r--chip/mchp/dma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/mchp/dma.c b/chip/mchp/dma.c
index 567cb9c29a..1c491729cd 100644
--- a/chip/mchp/dma.c
+++ b/chip/mchp/dma.c
@@ -206,10 +206,11 @@ int dma_bytes_done(dma_chan_t *chan, int orig_count)
int bcnt = 0;
if (chan != NULL) {
- if (chan->ctrl & MCHP_DMA_RUN)
+ if (chan->ctrl & MCHP_DMA_RUN) {
bcnt = (int)chan->mem_end;
bcnt -= (int)chan->mem_start;
bcnt = orig_count - bcnt;
+ }
}
return bcnt;