]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
flash/nor/sfdp: Fix broken DEBUG log line on macOS
authorPete Moore <pmoore@mozilla.com>
Mon, 16 Dec 2024 15:55:06 +0000 (16:55 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Sat, 21 Dec 2024 10:25:58 +0000 (10:25 +0000)
https://review.openocd.org/c/openocd/+/8439 changed variable `words`
from uint8_t to unsigned int in sfdp.c but failed to update the
LOG_DEBUG line to reflect the new type. On macOS this caused:

src/flash/nor/sfdp.c:107:28: error: format specifies type 'unsigned
char' but the argument has type 'unsigned int' [-Werror,-Wformat]

The formatting of the debug line has been updated to reflect the updated
type.

Change-Id: Ifc7ddb1279ab2603901c969d9c09af847f3a3caf
Signed-off-by: Pete Moore <pmoore@mozilla.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8660
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/flash/nor/sfdp.c

index 917f1626fb0bb72562e0cd646af42cafef63e6ad..8e25ba680b570928d6c8e16a94134e5efcfc490e 100644 (file)
@@ -103,7 +103,7 @@ int spi_sfdp(struct flash_bank *bank, struct flash_device *dev,
                uint16_t id = (((pheaders[k].ptr) >> 16) & 0xFF00) | (pheaders[k].revision & 0xFF);
                uint32_t ptr = pheaders[k].ptr & 0xFFFFFF;
 
-               LOG_DEBUG("pheader %d len=0x%02" PRIx8 " id=0x%04" PRIx16
+               LOG_DEBUG("pheader %d len=0x%02x id=0x%04" PRIx16
                        " ptr=0x%06" PRIx32, k, words, id, ptr);
 
                /* retrieve parameter table */