]> git.sur5r.net Git - openocd/commitdiff
FLASH/STMSMI: fix clang "dead store" warning
authorAntonio Borneo <borneo.antonio@gmail.com>
Sat, 22 Oct 2011 11:23:10 +0000 (19:23 +0800)
committerØyvind Harboe <oyvindharboe@gmail.com>
Sat, 22 Oct 2011 11:45:29 +0000 (11:45 +0000)
Change-Id: Icfdefdc48432db2057d3fea19dc424571d2385eb
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/50
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
src/flash/nor/stmsmi.c

index d298b36803b7ff3016314df076cf3850cd9a854d..bfec789452f2b52c60a0c7da9812c5c0e1f60ff7 100644 (file)
@@ -714,20 +714,17 @@ static int stmsmi_protect_check(struct flash_bank *bank)
 static int get_stmsmi_info(struct flash_bank *bank, char *buf, int buf_size)
 {
        struct stmsmi_flash_bank *stmsmi_info = bank->driver_priv;
-       int printed;
 
        if (!(stmsmi_info->probed))
        {
-               printed = snprintf(buf, buf_size,
+               snprintf(buf, buf_size,
                        "\nSMI flash bank not probed yet\n");
                return ERROR_OK;
        }
 
-       printed = snprintf(buf, buf_size, "\nSMI flash information:\n"
+       snprintf(buf, buf_size, "\nSMI flash information:\n"
                "  Device \'%s\' (ID 0x%08x)\n",
                stmsmi_info->dev->name, stmsmi_info->dev->device_id);
-       buf += printed;
-       buf_size -= printed;
 
        return ERROR_OK;
 }