[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [PATCH]: 54acef1 coding style: fix print of hex values as decimal
From:       gerrit () openocd ! org (gerrit)
Date:       2020-04-27 15:59:23
Message-ID: 20200427155923.463B44A0AE1 () mail ! openocd ! org
[Download RAW message or body]

This is an automated email from Gerrit.

Antonio Borneo (borneo.antonio@gmail.com) just uploaded a new patch set to Gerrit, \
which you can find at http://openocd.zylin.com/5624

-- gerrit

commit 54acef1503aec12e9af63b6997de3aff6ffe097c
Author: Antonio Borneo <borneo.antonio@gmail.com>
Date:   Mon May 6 14:22:06 2019 +0200

    coding style: fix print of hex values as decimal
    
    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>

diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c
index 81ffdc4..bb72dc7 100644
--- a/src/flash/nor/pic32mx.c
+++ b/src/flash/nor/pic32mx.c
@@ -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%03" PRIx32 " != \
0x%03" PRIx32 ")\n",  (unsigned)((device_id >> 1) & 0x7ff),
 				 PIC32MX_MANUF_ID);
 		return ERROR_FLASH_OPERATION_FAILED;
diff --git a/src/target/image.c b/src/target/image.c
index 9bd8f6b..09efc0f 100644
--- a/src/target/image.c
+++ b/src/target/image.c
@@ -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%z" PRIx32 " 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);

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic