From 8079a6a558526730d994aa56bf23139fbad2141c Mon Sep 17 00:00:00 2001 From: Caveh Jalali Date: Tue, 1 Sep 2020 20:37:49 -0700 Subject: libpayload/usb: Fix printf format string mismatches in debug messages This fixes format string mismatch errors in the USB subsystem found by the compiler's format string checker. BUG=b:167517417 TEST=enabled all USB controllers on volteer and fixed resulting compiler errors when USB_DEBUG is enabled. Change-Id: I4dc70baefb3cd82fcc915cc2e7f68719cf6870cc Signed-off-by: Caveh Jalali Reviewed-on: https://review.coreboot.org/c/coreboot/+/45024 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- payloads/libpayload/drivers/usb/ehci.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'payloads/libpayload/drivers/usb/ehci.c') diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c index 97caf202d9..58fc64eead 100644 --- a/payloads/libpayload/drivers/usb/ehci.c +++ b/payloads/libpayload/drivers/usb/ehci.c @@ -28,6 +28,7 @@ //#define USB_DEBUG +#include #include #include #include @@ -46,15 +47,15 @@ static void dump_td(u32 addr) usb_debug("|..[OUT]............................................|\n"); else usb_debug("|..[]...............................................|\n"); - usb_debug("|:|============ EHCI TD at [0x%08lx] ==========|:|\n", addr); - usb_debug("|:| ERRORS = [%ld] | TOKEN = [0x%08lx] | |:|\n", + usb_debug("|:|============ EHCI TD at [0x%08"PRIx32"] ==========|:|\n", addr); + usb_debug("|:| ERRORS = [%"PRId32"] | TOKEN = [0x%08"PRIx32"] | |:|\n", 3 - ((td->token & QTD_CERR_MASK) >> QTD_CERR_SHIFT), td->token); usb_debug("|:+-----------------------------------------------+:|\n"); - usb_debug("|:| Next qTD [0x%08lx] |:|\n", td->next_qtd); + usb_debug("|:| Next qTD [0x%08"PRIx32"] |:|\n", td->next_qtd); usb_debug("|:+-----------------------------------------------+:|\n"); - usb_debug("|:| Alt. Next qTD [0x%08lx] |:|\n", td->alt_next_qtd); + usb_debug("|:| Alt. Next qTD [0x%08"PRIx32"] |:|\n", td->alt_next_qtd); usb_debug("|:+-----------------------------------------------+:|\n"); - usb_debug("|:| | Bytes to Transfer |[%05ld] |:|\n", (td->token & QTD_TOTAL_LEN_MASK) >> 16); + usb_debug("|:| | Bytes to Transfer |[%05"PRId32"] |:|\n", (td->token & QTD_TOTAL_LEN_MASK) >> 16); usb_debug("|:| | PID CODE: | [%ld] |:|\n", (td->token & (3UL << 8)) >> 8); usb_debug("|:| | Interrupt On Complete (IOC) | [%ld] |:|\n", (td->token & (1UL << 15)) >> 15); usb_debug("|:| | Status Active | [%ld] |:|\n", (td->token & (1UL << 7)) >> 7); @@ -277,9 +278,11 @@ static int wait_for_tds(qtd_t *head) if (cur->next_qtd & 1) { break; } - if (0) dump_td(virt_to_phys(cur)); + if (0) + dump_td(virt_to_phys(cur)); /* helps debugging the TD chain */ - if (0) usb_debug("\nmoving from %x to %x\n", cur, phys_to_virt(cur->next_qtd)); + if (0) + usb_debug("\nmoving from %p to %p\n", cur, phys_to_virt(cur->next_qtd)); cur = phys_to_virt(cur->next_qtd); } return result; -- cgit v1.2.3