flash/nor: mrvlqspi: fix printf formatting issues 77/2577/2
authorMahavir Jain <mjain@marvell.com>
Thu, 5 Mar 2015 12:12:54 +0000 (17:42 +0530)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 25 Mar 2015 21:39:48 +0000 (21:39 +0000)
Change-Id: I74cfce7bb8dbc13fbc3005b5a96213417f93a9f2
Signed-off-by: Mahavir Jain <mjain@marvell.com>
Reviewed-on: http://openocd.zylin.com/2577
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Stian Skjelstad <stian@nixia.no>
src/flash/nor/mrvlqspi.c

index a5cc1ca025c3077e9b1ab05f1eeaec329fbe4ae7..0dfe6f86fe60a5e1f2beb5b3e9dbf44dbfbfdbca 100644 (file)
@@ -161,7 +161,7 @@ static int mrvlqspi_set_ss_state(struct flash_bank *bank, bool state, int timeou
                                mrvlqspi_get_reg(bank, CNTL), &regval);
                if (retval != ERROR_OK)
                        return retval;
-               LOG_DEBUG("status: 0x%x", regval);
+               LOG_DEBUG("status: 0x%08" PRIx32, regval);
                if ((regval & XFER_RDY) == XFER_RDY)
                        break;
                if (timeout-- <= 0) {
@@ -216,7 +216,7 @@ static int mrvlqspi_stop_transfer(struct flash_bank *bank)
                                mrvlqspi_get_reg(bank, CNTL), &regval);
                if (retval != ERROR_OK)
                        return retval;
-               LOG_DEBUG("status: 0x%x", regval);
+               LOG_DEBUG("status: 0x%08" PRIx32, regval);
                if ((regval & (XFER_RDY | WFIFO_EMPTY)) ==
                                        (XFER_RDY | WFIFO_EMPTY))
                        break;
@@ -245,7 +245,7 @@ static int mrvlqspi_stop_transfer(struct flash_bank *bank)
                                mrvlqspi_get_reg(bank, CONF), &regval);
                if (retval != ERROR_OK)
                        return retval;
-               LOG_DEBUG("status: 0x%x", regval);
+               LOG_DEBUG("status: 0x%08" PRIx32, regval);
                if ((regval & XFER_START) == 0)
                        break;
                if (timeout-- <= 0) {
@@ -286,7 +286,7 @@ static int mrvlqspi_fifo_flush(struct flash_bank *bank, int timeout)
                                mrvlqspi_get_reg(bank, CONF), &val);
                if (retval != ERROR_OK)
                        return retval;
-               LOG_DEBUG("status: 0x%x", val);
+               LOG_DEBUG("status: 0x%08" PRIX32, val);
                if ((val & FIFO_FLUSH) == 0)
                        break;
                if (timeout-- <= 0) {
@@ -310,7 +310,7 @@ static int mrvlqspi_read_byte(struct flash_bank *bank, uint8_t *data)
                                mrvlqspi_get_reg(bank, CNTL), &val);
                if (retval != ERROR_OK)
                        return retval;
-               LOG_DEBUG("status: 0x%x", val);
+               LOG_DEBUG("status: 0x%08" PRIx32, val);
                if ((val & RFIFO_EMPTY) == 0)
                        break;
                usleep(10);
@@ -455,7 +455,8 @@ static int mrvlqspi_read_id(struct flash_bank *bank, uint32_t *id)
                        return retval;
        }
 
-       LOG_DEBUG("ID is 0x%x 0x%x 0x%x", id_buf[0], id_buf[1], id_buf[2]);
+       LOG_DEBUG("ID is 0x%02" PRIx8 " 0x%02" PRIx8 " 0x%02" PRIx8,
+                                       id_buf[0], id_buf[1], id_buf[2]);
        retval = mrvlqspi_set_ss_state(bank, QSPI_SS_DISABLE, QSPI_TIMEOUT);
        if (retval != ERROR_OK)
                return retval;
@@ -854,11 +855,11 @@ static int mrvlqspi_probe(struct flash_bank *bank)
                }
 
        if (!mrvlqspi_info->dev) {
-               LOG_ERROR("Unknown flash device ID 0x%08x", id);
+               LOG_ERROR("Unknown flash device ID 0x%08" PRIx32, id);
                return ERROR_FAIL;
        }
 
-       LOG_INFO("Found flash device \'%s\' ID 0x%08x",
+       LOG_INFO("Found flash device \'%s\' ID 0x%08" PRIx32,
                mrvlqspi_info->dev->name, mrvlqspi_info->dev->device_id);
 
        /* Set correct size value */
@@ -918,7 +919,7 @@ int mrvlqspi_get_info(struct flash_bank *bank, char *buf, int buf_size)
        }
 
        snprintf(buf, buf_size, "\nQSPI flash information:\n"
-               "  Device \'%s\' ID 0x%08x\n",
+               "  Device \'%s\' ID 0x%08" PRIx32 "\n",
                mrvlqspi_info->dev->name, mrvlqspi_info->dev->device_id);
 
        return ERROR_OK;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)