Commit f2e3e943 authored by Zheng Zengkai's avatar Zheng Zengkai
Browse files

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=]

drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: In function ‘veth_recv_pkt’:
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:74:37: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 7 has type ‘dma_addr_t {aka unsigned int}’ [-Wformat=]

Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 80ed6b32
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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/%zu", 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 %zu bytes, pos: %u, total len: %u, left: %zd.",
	    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: %zd, pos: %d, buf len: %zu, 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: %zu, 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: %zd, 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 %zu, pos: %u (%u/%u)",
	    count, g_read_pos,
	    pdev->ptx_queue->pshmqhd_v->count,
	    pdev->ptx_queue->pshmqhd_v->total);
+1 −1
Original line number Diff line number Diff line
@@ -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 %zu\n", msg_len);

		if (copy_from_user(hdr->data, msg, msg_len)) {
			BMA_LOG(DLOG_ERROR, "copy_from_user error\n");
+1 −1
Original line number Diff line number Diff line
@@ -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 %zu\n",
			edma_host->msg_send_write,
			HOST_MAX_SEND_MBX_LEN - SIZE_OF_MBX_HDR);
		edma_host->msg_send_write = 0;
+2 −2
Original line number Diff line number Diff line
@@ -1488,8 +1488,8 @@ 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,",
			 pbd_v->dma_p, dma_map);
			 "dma_p=0x%llx,dma_map=%pad,",
			 pbd_v->dma_p, &dma_map);

		VETH_LOG(DLOG_DEBUG,
			 "skb=%p,skb->data=%p,skb->len=%d,tail=%d,shm_off=%d\n",