From 310c9800c72f37dd50e855513badc908fcfbafcf Mon Sep 17 00:00:00 2001 From: Tarek BOCHKATI Date: Mon, 11 Jan 2021 19:21:06 +0100 Subject: [PATCH 1/1] flash/stmqspi: fix build error with -Werror=maybe-uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit using gcc 9.3 on ubuntu focal fossa with -Werror=maybe-uninitialized we get this error: /src/flash/nor/stmqspi.c: In function ‘read_flash_id’: /src/flash/nor/stmqspi.c:1948:6: error: ‘retval’ may be used uninitialized Change-Id: Ifd8ae60df847fc61e22ca100c008e3914c9af79b Signed-off-by: Tarek BOCHKATI Reviewed-on: http://openocd.zylin.com/6012 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI Reviewed-by: Antonio Borneo --- src/flash/nor/stmqspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c index f54e4975dd..a013336a0f 100644 --- a/src/flash/nor/stmqspi.c +++ b/src/flash/nor/stmqspi.c @@ -1945,7 +1945,7 @@ static int read_flash_id(struct flash_bank *bank, uint32_t *id1, uint32_t *id2) uint32_t io_base = stmqspi_info->io_base; uint8_t byte; unsigned int type, count, len1, len2; - int retval; + int retval = ERROR_OK; /* invalidate both ids */ *id1 = 0; -- 2.30.2