Skip to content

Commit

Permalink
chore: fix wformat warning
Browse files Browse the repository at this point in the history
Signed-off-by: sakumisu <1203593632@qq.com>
  • Loading branch information
sakumisu committed Jan 26, 2025
1 parent c827c2e commit 95baa78
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions class/cdc/usbh_cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ static void print_ntb_parameters(struct cdc_ncm_ntb_parameters *param)
USB_LOG_RAW("wLength: 0x%02x \r\n", param->wLength);
USB_LOG_RAW("bmNtbFormatsSupported: %s \r\n", param->bmNtbFormatsSupported ? "NTB16" : "NTB32");

USB_LOG_RAW("dwNtbInMaxSize: 0x%04x \r\n", param->dwNtbInMaxSize);
USB_LOG_RAW("dwNtbInMaxSize: 0x%08lx \r\n", param->dwNtbInMaxSize);
USB_LOG_RAW("wNdbInDivisor: 0x%02x \r\n", param->wNdbInDivisor);
USB_LOG_RAW("wNdbInPayloadRemainder: 0x%02x \r\n", param->wNdbInPayloadRemainder);
USB_LOG_RAW("wNdbInAlignment: 0x%02x \r\n", param->wNdbInAlignment);

USB_LOG_RAW("dwNtbOutMaxSize: 0x%04x \r\n", param->dwNtbOutMaxSize);
USB_LOG_RAW("dwNtbOutMaxSize: 0x%08lx \r\n", param->dwNtbOutMaxSize);
USB_LOG_RAW("wNdbOutDivisor: 0x%02x \r\n", param->wNdbOutDivisor);
USB_LOG_RAW("wNdbOutPayloadRemainder: 0x%02x \r\n", param->wNdbOutPayloadRemainder);
USB_LOG_RAW("wNdbOutAlignment: 0x%02x \r\n", param->wNdbOutAlignment);
Expand Down
20 changes: 10 additions & 10 deletions class/wireless/usbh_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ static int usbh_rndis_init_msg_transfer(struct usbh_rndis *rndis_class)

rndis_class->max_transfer_pkts = resp->MaxPacketsPerTransfer;
rndis_class->max_transfer_size = resp->MaxTransferSize;
USB_LOG_INFO("MaxPacketsPerTransfer:%d\r\n", resp->MaxPacketsPerTransfer);
USB_LOG_INFO("MaxTransferSize:%d\r\n", resp->MaxTransferSize);
USB_LOG_INFO("MaxPacketsPerTransfer:%ld\r\n", resp->MaxPacketsPerTransfer);
USB_LOG_INFO("MaxTransferSize:%ld\r\n", resp->MaxTransferSize);

return ret;
}
Expand Down Expand Up @@ -278,8 +278,8 @@ static int usbh_rndis_connect(struct usbh_hubport *hport, uint8_t intf)
struct usb_endpoint_descriptor *ep_desc;
int ret;
uint32_t *oid_support_list;
unsigned int oid = 0;
unsigned int oid_num = 0;
uint32_t oid = 0;
uint32_t oid_num = 0;
uint32_t data_len;
uint8_t tmp_buffer[512];
uint8_t data[32];
Expand Down Expand Up @@ -319,7 +319,7 @@ static int usbh_rndis_connect(struct usbh_hubport *hport, uint8_t intf)
return ret;
}
oid_num = (data_len / 4);
USB_LOG_INFO("rndis query OID_GEN_SUPPORTED_LIST success,oid num :%d\r\n", oid_num);
USB_LOG_INFO("rndis query OID_GEN_SUPPORTED_LIST success,oid num :%ld\r\n", oid_num);

oid_support_list = (uint32_t *)tmp_buffer;

Expand Down Expand Up @@ -380,10 +380,10 @@ static int usbh_rndis_connect(struct usbh_hubport *hport, uint8_t intf)
}
break;
default:
USB_LOG_WRN("Ignore rndis query iod:%08x\r\n", oid);
USB_LOG_WRN("Ignore rndis query iod:%08lx\r\n", oid);
continue;
}
USB_LOG_INFO("rndis query iod:%08x success\r\n", oid);
USB_LOG_INFO("rndis query iod:%08lx success\r\n", oid);
}

uint32_t packet_filter = 0x0f;
Expand Down Expand Up @@ -414,7 +414,7 @@ static int usbh_rndis_connect(struct usbh_hubport *hport, uint8_t intf)
usbh_rndis_run(rndis_class);
return ret;
query_errorout:
USB_LOG_ERR("rndis query iod:%08x error\r\n", oid);
USB_LOG_ERR("rndis query iod:%08lx error\r\n", oid);
return ret;
}

Expand Down Expand Up @@ -501,7 +501,7 @@ void usbh_rndis_rx_thread(CONFIG_USB_OSAL_THREAD_SET_ARGV)
uint32_t total_len = g_rndis_rx_length;

while (g_rndis_rx_length > 0) {
USB_LOG_DBG("rxlen:%d\r\n", g_rndis_rx_length);
USB_LOG_DBG("rxlen:%ld\r\n", g_rndis_rx_length);

pmsg = (rndis_data_packet_t *)(g_rndis_rx_buffer + pmg_offset);

Expand All @@ -523,7 +523,7 @@ void usbh_rndis_rx_thread(CONFIG_USB_OSAL_THREAD_SET_ARGV)
g_rndis_rx_length = 0;
}
} else {
USB_LOG_ERR("offset:%d,remain:%d,total:%d\r\n", pmg_offset, g_rndis_rx_length, total_len);
USB_LOG_ERR("offset:%ld,remain:%ld,total:%ld\r\n", pmg_offset, g_rndis_rx_length, total_len);
g_rndis_rx_length = 0;
USB_LOG_ERR("Error rndis packet message\r\n");
}
Expand Down
2 changes: 1 addition & 1 deletion common/usb_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static inline void usb_hexdump(const void *ptr, uint32_t buflen)
(void)buf;

for (i = 0; i < buflen; i += 16) {
CONFIG_USB_PRINTF("%08X:", i);
CONFIG_USB_PRINTF("%08lx:", i);

for (j = 0; j < 16; j++)
if (i + j < buflen) {
Expand Down

0 comments on commit 95baa78

Please sign in to comment.