diff options
author | Martin Roth <martinroth@chromium.org> | 2016-10-26 11:21:16 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-16 19:04:31 -0800 |
commit | d961991d6793e6875541fd26e9f715d5a9a7da4e (patch) | |
tree | b2483aff9762f002df42d3023227a6af50aa72eb | |
parent | 3298310a1b38afab3403d680263c23262aea534d (diff) | |
download | chrome-ec-d961991d6793e6875541fd26e9f715d5a9a7da4e.tar.gz |
btle_ll.c: Initialize variables to fix GCC warnings
The variable last_rx_time shouldn't be able to be used without being
initialized, so initialize it to make GCC 5.x & 6.x happy.
common/btle_ll.c: In function 'bluetooth_ll_task':
common/btle_ll.c:835:25: error: 'last_rx_time' may be used uninitialized
in this function [-Werror=maybe-uninitialized]
This does not change the size of any ec.*.flat file.
BRANCH=none
BUG=none
TEST=build succeeds under GCC 4.9.2, 5.3, and 6.2
Change-Id: I99f716fcb3c8c871e4f325eca3bf3cd622e727d1
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/411406
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | common/btle_ll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/btle_ll.c b/common/btle_ll.c index 74f690271b..fdf27d71c6 100644 --- a/common/btle_ll.c +++ b/common/btle_ll.c @@ -657,7 +657,7 @@ int connected_communicate(void) { int rv; long sleep_time; - int offset; + int offset = 0; uint64_t listen_time; uint8_t comm_channel = get_next_data_channel(&remap_table); @@ -758,7 +758,7 @@ static uint32_t start, end; void bluetooth_ll_task(void) { - uint64_t last_rx_time; + uint64_t last_rx_time = 0; CPRINTS("LL task init"); while (1) { |