chip/g/sps: Initialize received_data pointer to NULL

I don't think that the received_data pointer in sps_rx_interrupt can
actually be used without initialization in the current code flow, but
GCC 5.3 thinks that it can, and throws an error.

sps_check_rx() always sets the pointer or returns 0.  In either case
we should be ok, but initializing it to null here won't hurt anything
since it's not masking an actual error.

BUG=None
BRANCH=None
TEST=Build all boards successfully.

Change-Id: Idaea7efd1af3067c492a3ade4c89104e975f4c1d
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/370663
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
This commit is contained in:
Martin Roth
2016-08-15 14:55:37 -06:00
committed by chrome-bot
parent 61c45fb33e
commit 56cf05339f

View File

@@ -315,7 +315,7 @@ static void sps_advance_rx(int port, int data_size)
static void sps_rx_interrupt(uint32_t port, int cs_deasserted)
{
for (;;) {
uint8_t *received_data;
uint8_t *received_data = NULL;
size_t data_size;
data_size = sps_check_rx(port, &received_data);