driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4ETXO CVE: NA
-----------------------------------------
Fix following build warnings in arm32 builds:
drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c: In function ‘bma_cdev_add_msg’: drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h:92:20: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘size_t {aka unsigned int}’ [-Wformat=]
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- .../bma/cdev_veth_drv/virtual_cdev_eth_net.c | 14 +++++++------- .../net/ethernet/huawei/bma/edma_drv/bma_devintf.c | 2 +- .../net/ethernet/huawei/bma/edma_drv/edma_host.c | 2 +- drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c b/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c index 04ea55f4e0a2..99466848c034 100644 --- a/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c +++ b/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c @@ -605,7 +605,7 @@ static int edma_veth_cut_tx_packet_send(struct edma_eth_dev_s *eth_dev, do_queue_rate_limit(eth_dev->ptx_queue);
while (length > 0) { - LOG(DLOG_DEBUG, "length: %u/%lu", length, len); + LOG(DLOG_DEBUG, "length: %u/%u", length, len);
if (length > BSPPACKET_MTU_MAX) { /* fragment. */ @@ -1689,7 +1689,7 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev, start = dev->rx_packet[dev->rx_packet_head].packet + g_read_pos;
LOG(DLOG_DEBUG, - "User needs %ld bytes, pos: %u, total len: %u, left: %ld.", + "User needs %d bytes, pos: %u, total len: %u, left: %d.", count, g_read_pos, dev->rx_packet[dev->rx_packet_head].len, left); if (left <= 0) { /* No more data in this message, retry. */ @@ -1721,7 +1721,7 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev, }
LOG(DLOG_DEBUG, - "Copied bytes: %ld, pos: %d, buf len: %lu, free_packet: %d.", + "Copied bytes: %d, pos: %d, buf len: %u, free_packet: %d.", length, g_read_pos, count, free_packet);
if (packet) { @@ -1807,11 +1807,11 @@ ssize_t cdev_read(struct file *filp, char __user *data, if (!data || count >= MAX_PACKET_LEN) return -EFAULT;
- LOG(DLOG_DEBUG, "read begin, count: %ld, pos: %u.", count, g_read_pos); + LOG(DLOG_DEBUG, "read begin, count: %d, pos: %u.", count, g_read_pos);
length = cdev_copy_packet_to_user(dev, data, count);
- LOG(DLOG_DEBUG, "read done, length: %ld, pos: %u.", length, g_read_pos); + LOG(DLOG_DEBUG, "read done, length: %d, pos: %u.", length, g_read_pos);
return length; } @@ -1837,7 +1837,7 @@ ssize_t cdev_write(struct file *filp, const char __user *data, g_peer_not_ready = 0; }
- LOG(DLOG_DEBUG, "data length is %lu, pos: %u (%u/%u)", + LOG(DLOG_DEBUG, "data length is %u, pos: %u (%u/%u)", count, g_read_pos, pdev->ptx_queue->pshmqhd_v->count, pdev->ptx_queue->pshmqhd_v->total); @@ -1859,4 +1859,4 @@ MODULE_DESCRIPTION("HUAWEI CDEV DRIVER"); MODULE_LICENSE("GPL");
module_init(edma_cdev_init); -module_exit(edma_cdev_exit); \ No newline at end of file +module_exit(edma_cdev_exit); diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c b/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c index 7817f58f8635..2d63e44f0ed2 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c +++ b/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c @@ -497,7 +497,7 @@ int bma_cdev_add_msg(void *handle, const char __user *msg, size_t msg_len) hdr->sub_type = priv->user.sub_type; hdr->user_id = priv->user.user_id; hdr->datalen = msg_len; - BMA_LOG(DLOG_DEBUG, "msg_len is %ld\n", msg_len); + BMA_LOG(DLOG_DEBUG, "msg_len is %d\n", msg_len);
if (copy_from_user(hdr->data, msg, msg_len)) { BMA_LOG(DLOG_ERROR, "copy_from_user error\n"); diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c index 2d5f4ffd79d9..a89a4160dedd 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c +++ b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c @@ -789,7 +789,7 @@ static int edma_host_send_msg(struct edma_host_s *edma_host) if (edma_host->msg_send_write > HOST_MAX_SEND_MBX_LEN - SIZE_OF_MBX_HDR) { BMA_LOG(DLOG_ERROR, - "Length of send message %u is larger than %lu\n", + "Length of send message %u is larger than %u\n", edma_host->msg_send_write, HOST_MAX_SEND_MBX_LEN - SIZE_OF_MBX_HDR); edma_host->msg_send_write = 0; diff --git a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c index 9681ce3bfc7b..7b511c05c2e9 100644 --- a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c +++ b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c @@ -1488,7 +1488,7 @@ s32 veth_recv_pkt(struct bspveth_rxtx_q *prx_queue, int queue) skb->len, skb->protocol);
VETH_LOG(DLOG_DEBUG, - "dma_p=0x%llx,dma_map=0x%llx,", + "dma_p=0x%llx,dma_map=0x%x,", pbd_v->dma_p, dma_map);
VETH_LOG(DLOG_DEBUG,
NAK
-----邮件原件----- 发件人: Zheng Zengkai [mailto:zhengzengkai@huawei.com] 发送时间: 2022年1月8日 16:21 收件人: kernel@openeuler.org 抄送: Xiexiuqi xiexiuqi@huawei.com; zzk20210127@163.com 主题: [PATCH OLK-5.10] BMA: Fix format string compile warning in arm32 builds
driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4ETXO CVE: NA
-----------------------------------------
Fix following build warnings in arm32 builds:
drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c: In function ‘bma_cdev_add_msg’: drivers/net/ethernet/huawei/bma/edma_drv/bma_pci.h:92:20: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘size_t {aka unsigned int}’ [-Wformat=]
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- .../bma/cdev_veth_drv/virtual_cdev_eth_net.c | 14 +++++++------- .../net/ethernet/huawei/bma/edma_drv/bma_devintf.c | 2 +- .../net/ethernet/huawei/bma/edma_drv/edma_host.c | 2 +- drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c b/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c index 04ea55f4e0a2..99466848c034 100644 --- a/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net.c +++ b/drivers/net/ethernet/huawei/bma/cdev_veth_drv/virtual_cdev_eth_net +++ .c @@ -605,7 +605,7 @@ static int edma_veth_cut_tx_packet_send(struct edma_eth_dev_s *eth_dev, do_queue_rate_limit(eth_dev->ptx_queue);
while (length > 0) { - LOG(DLOG_DEBUG, "length: %u/%lu", length, len); + LOG(DLOG_DEBUG, "length: %u/%u", length, len);
if (length > BSPPACKET_MTU_MAX) { /* fragment. */ @@ -1689,7 +1689,7 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev, start = dev->rx_packet[dev->rx_packet_head].packet + g_read_pos;
LOG(DLOG_DEBUG, - "User needs %ld bytes, pos: %u, total len: %u, left: %ld.", + "User needs %d bytes, pos: %u, total len: %u, left: %d.", count, g_read_pos, dev->rx_packet[dev->rx_packet_head].len, left); if (left <= 0) { /* No more data in this message, retry. */ @@ -1721,7 +1721,7 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev, }
LOG(DLOG_DEBUG, - "Copied bytes: %ld, pos: %d, buf len: %lu, free_packet: %d.", + "Copied bytes: %d, pos: %d, buf len: %u, free_packet: %d.", length, g_read_pos, count, free_packet);
if (packet) { @@ -1807,11 +1807,11 @@ ssize_t cdev_read(struct file *filp, char __user *data, if (!data || count >= MAX_PACKET_LEN) return -EFAULT;
- LOG(DLOG_DEBUG, "read begin, count: %ld, pos: %u.", count, g_read_pos); + LOG(DLOG_DEBUG, "read begin, count: %d, pos: %u.", count, g_read_pos);
length = cdev_copy_packet_to_user(dev, data, count);
- LOG(DLOG_DEBUG, "read done, length: %ld, pos: %u.", length, g_read_pos); + LOG(DLOG_DEBUG, "read done, length: %d, pos: %u.", length, +g_read_pos);
return length; } @@ -1837,7 +1837,7 @@ ssize_t cdev_write(struct file *filp, const char __user *data, g_peer_not_ready = 0; }
- LOG(DLOG_DEBUG, "data length is %lu, pos: %u (%u/%u)", + LOG(DLOG_DEBUG, "data length is %u, pos: %u (%u/%u)", count, g_read_pos, pdev->ptx_queue->pshmqhd_v->count, pdev->ptx_queue->pshmqhd_v->total); @@ -1859,4 +1859,4 @@ MODULE_DESCRIPTION("HUAWEI CDEV DRIVER"); MODULE_LICENSE("GPL");
module_init(edma_cdev_init); -module_exit(edma_cdev_exit); \ No newline at end of file +module_exit(edma_cdev_exit); diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c b/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c index 7817f58f8635..2d63e44f0ed2 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c +++ b/drivers/net/ethernet/huawei/bma/edma_drv/bma_devintf.c @@ -497,7 +497,7 @@ int bma_cdev_add_msg(void *handle, const char __user *msg, size_t msg_len) hdr->sub_type = priv->user.sub_type; hdr->user_id = priv->user.user_id; hdr->datalen = msg_len; - BMA_LOG(DLOG_DEBUG, "msg_len is %ld\n", msg_len); + BMA_LOG(DLOG_DEBUG, "msg_len is %d\n", msg_len);
if (copy_from_user(hdr->data, msg, msg_len)) { BMA_LOG(DLOG_ERROR, "copy_from_user error\n"); diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c index 2d5f4ffd79d9..a89a4160dedd 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c +++ b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.c @@ -789,7 +789,7 @@ static int edma_host_send_msg(struct edma_host_s *edma_host) if (edma_host->msg_send_write > HOST_MAX_SEND_MBX_LEN - SIZE_OF_MBX_HDR) { BMA_LOG(DLOG_ERROR, - "Length of send message %u is larger than %lu\n", + "Length of send message %u is larger than %u\n", edma_host->msg_send_write, HOST_MAX_SEND_MBX_LEN - SIZE_OF_MBX_HDR); edma_host->msg_send_write = 0; diff --git a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c index 9681ce3bfc7b..7b511c05c2e9 100644 --- a/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c +++ b/drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c @@ -1488,7 +1488,7 @@ s32 veth_recv_pkt(struct bspveth_rxtx_q *prx_queue, int queue) skb->len, skb->protocol);
VETH_LOG(DLOG_DEBUG, - "dma_p=0x%llx,dma_map=0x%llx,", + "dma_p=0x%llx,dma_map=0x%x,", pbd_v->dma_p, dma_map);
VETH_LOG(DLOG_DEBUG, -- 2.20.1 _______________________________________________ Kernel mailing list -- kernel@openeuler.org To unsubscribe send an email to kernel-leave@openeuler.org