Skip to content

Commit

Permalink
flash/nor/sfdp: Fix broken DEBUG log line on macOS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
petemoore authored and tom-van committed Dec 21, 2024
1 parent 133dd9d commit d60e1f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flash/nor/sfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit d60e1f6

Please sign in to comment.