]> git.gag.com Git - fw/openocd/commitdiff
coding style: fix print of hex values as decimal
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 6 May 2019 12:22:06 +0000 (14:22 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Wed, 8 Jul 2020 21:07:56 +0000 (22:07 +0100)
It is an error to prefix with "0x" the print of values in decimal.
Replace the incorrect decimal format specifier with PRIx32.

Issue identified by checkpatch script from Linux kernel v5.1 using
the command

find src/ -type f -exec ./tools/scripts/checkpatch.pl \
-q --types PRINTF_0XDECIMAL -f {} \;

Change-Id: I2eb867ef654527b2737ba573a405ec8f97c6a739
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5624
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/flash/nor/pic32mx.c
src/target/image.c

index 99b841991fedb407385127fddc0d7099822d4b22..b214642a0931506616344cd2d0b39a8924426401 100644 (file)
@@ -817,7 +817,7 @@ static int pic32mx_info(struct flash_bank *bank, char *buf, int buf_size)
 
        if (((device_id >> 1) & 0x7ff) != PIC32MX_MANUF_ID) {
                snprintf(buf, buf_size,
-                                "Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n",
+                                "Cannot identify target as a PIC32MX family (manufacturer 0x%03x != 0x%03x)\n",
                                 (unsigned)((device_id >> 1) & 0x7ff),
                                 PIC32MX_MANUF_ID);
                return ERROR_FLASH_OPERATION_FAILED;
index 9bd8f6b0c6f492074ae56b0571273a5329efd784..1003c3bdce479a56729e5cf1b3b458a2ffb9dbf4 100644 (file)
@@ -497,7 +497,7 @@ static int image_elf_read_section(struct image *image,
        if (offset < field32(elf, segment->p_filesz)) {
                /* maximal size present in file for the current segment */
                read_size = MIN(size, field32(elf, segment->p_filesz) - offset);
-               LOG_DEBUG("read elf: size = 0x%zu at 0x%" PRIx32 "", read_size,
+               LOG_DEBUG("read elf: size = 0x%zx at 0x%" PRIx32 "", read_size,
                        field32(elf, segment->p_offset) + offset);
                /* read initialized area of the segment */
                retval = fileio_seek(elf->fileio, field32(elf, segment->p_offset) + offset);