summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martinroth@chromium.org>2016-10-26 11:21:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-11-16 19:04:30 -0800
commit3298310a1b38afab3403d680263c23262aea534d (patch)
tree6ee397e843a2c2f46511b64ee2a83b0e4a4a7c01
parent645e4ceef4b87b55262371ade74360a8c9856015 (diff)
downloadchrome-ec-3298310a1b38afab3403d680263c23262aea534d.tar.gz
btle_ll.c: Initialize variable "offset" before it's used
The variable "offset" gets configured if it's not the first data packet, but gets used even on the first data packet. common/btle_ll.c: In function 'connected_communicate': common/btle_ll.c:729:15: error: 'offset' 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: Ib3882aab3e081afc4b00dc02b002ba4c590cb0f9 Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403500 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/btle_ll.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/btle_ll.c b/common/btle_ll.c
index 664ff1296d..74f690271b 100644
--- a/common/btle_ll.c
+++ b/common/btle_ll.c
@@ -724,6 +724,8 @@ int connected_communicate(void)
if (!is_first_data_packet)
offset = last_receive_time + conn_params.connInterval
- get_time().val;
+ else
+ offset = 0;
rv = ble_rx(&ll_rcv_packet,
offset + conn_params.transmitWindowSize,