This is an automated email from Gerrit.

Antonio Borneo ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5681

-- gerrit

commit 12af1864a7bd1a9559518168fa45df404866be99
Author: Antonio Borneo <[email protected]>
Date:   Thu May 14 22:28:21 2020 +0200

    flash/nor/jtagspi: workaround for build error on gcc 10.1.0
    
    The new inter-procedural analysis of gcc 10 identifies two cases
    of variable potentially used uninitialized.
    This can really happen if jtagspi_cmd() in jtagspi_read_status()
    returns error and then 'status' don't get initialized either in
    jtagspi_wait() or in jtagspi_write_enable().
    
    This change is just a workaround to build openocd on new compiler.
    The correct change should propagate the error, but I do not own
    the HW to verify or test such changes.
    
    Change-Id: I41fa25fc42dc01b5bc9aa55a108a58e89e157a35
    Signed-off-by: Antonio Borneo <[email protected]>
    Fixes: 3c9bd7c6f30a ("flash: nor: jtagspi: fix jtagspi_read_status() 
warning")
    Fixes: d25355473da9 ("flash/nor/jtagspi: add JTAGSPI driver")

diff --git a/src/flash/nor/jtagspi.c b/src/flash/nor/jtagspi.c
index f6e311a..9fbabc9 100644
--- a/src/flash/nor/jtagspi.c
+++ b/src/flash/nor/jtagspi.c
@@ -239,7 +239,7 @@ static void jtagspi_read_status(struct flash_bank *bank, 
uint32_t *status)
 
 static int jtagspi_wait(struct flash_bank *bank, int timeout_ms)
 {
-       uint32_t status;
+       uint32_t status = 0;
        int64_t t0 = timeval_ms();
        int64_t dt;
 
@@ -259,7 +259,7 @@ static int jtagspi_wait(struct flash_bank *bank, int 
timeout_ms)
 
 static int jtagspi_write_enable(struct flash_bank *bank)
 {
-       uint32_t status;
+       uint32_t status = 0;
 
        jtagspi_cmd(bank, SPIFLASH_WRITE_ENABLE, NULL, NULL, 0);
        jtagspi_read_status(bank, &status);

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to