Commit 8e84d840 authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Carles Cufi
Browse files

usb: Fix build for 64 bit platforms



Use proper format for size_t type eliminating warnings of type:

...
error: format '%u' expects argument of type 'unsigned int', but
argument 2 has type 'size_t' {aka 'long unsigned int'}
[-Werror=format=]
...

Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
parent 5b0b6e36
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static int vrt_handle_out(const struct device *dev,
	min_len = MIN(pkt->length, net_buf_tailroom(buf));
	net_buf_add_mem(buf, pkt->data, min_len);

	LOG_DBG("Handle data OUT, %zu | %u", pkt->length, net_buf_tailroom(buf));
	LOG_DBG("Handle data OUT, %zu | %zu", pkt->length, net_buf_tailroom(buf));

	if (net_buf_tailroom(buf) == 0 || pkt->length < ep_cfg->mps) {
		buf = udc_buf_get(dev, ep);
@@ -245,7 +245,7 @@ static int vrt_handle_in(const struct device *dev,
		return vrt_request_reply(dev, pkt, UVB_REPLY_NACK);
	}

	LOG_DBG("Handle data IN, %u | %u | %u",
	LOG_DBG("Handle data IN, %zu | %u | %u",
		pkt->length, buf->len, ep_cfg->mps);
	min_len = MIN(pkt->length, buf->len);
	memcpy(pkt->data, buf->data, min_len);
@@ -258,7 +258,7 @@ static int vrt_handle_in(const struct device *dev,
			goto continue_in;
		}

		LOG_DBG("Finish data IN %u | %u", pkt->length, buf->len);
		LOG_DBG("Finish data IN %zu | %u", pkt->length, buf->len);
		buf = udc_buf_get(dev, ep);

		if (ep == USB_CONTROL_EP_IN) {
+2 −2
Original line number Diff line number Diff line
@@ -248,11 +248,11 @@ static int vrt_hrslt_success(const struct device *dev,
			length = MIN(net_buf_tailroom(buf), pkt->length);
			net_buf_add(buf, length);
			if (pkt->length > xfer->mps) {
				LOG_ERR("Ambiguous packet with the length %u",
				LOG_ERR("Ambiguous packet with the length %zu",
					pkt->length);
			}

			LOG_DBG("IN chunk %zu out of %u", length, net_buf_tailroom(buf));
			LOG_DBG("IN chunk %zu out of %zu", length, net_buf_tailroom(buf));
			if (pkt->length < xfer->mps || !net_buf_tailroom(buf)) {
				err = uhc_xfer_done(xfer);
			}
+2 −2
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static int lb_control_to_host(struct usbd_class_node *c_nd,
				MIN(sizeof(lb_buf), setup->wLength));
		usbd_ep_ctrl_enqueue(uds_ctx, buf);

		LOG_WRN("Device-to-Host, wLength %u | %u", setup->wLength,
		LOG_WRN("Device-to-Host, wLength %u | %zu", setup->wLength,
			MIN(sizeof(lb_buf), setup->wLength));

		return 0;
@@ -250,7 +250,7 @@ static int lb_control_to_dev(struct usbd_class_node *c_nd,
	}

	if (setup->bRequest == LB_VENDOR_REQ_OUT) {
		LOG_WRN("Host-to-Device, wLength %u | %u", setup->wLength,
		LOG_WRN("Host-to-Device, wLength %u | %zu", setup->wLength,
			MIN(sizeof(lb_buf), buf->len));
		memcpy(lb_buf, buf->data, MIN(sizeof(lb_buf), buf->len));
		return 0;
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static void usbd_ep_ctrl_set_zlp(struct usbd_contex *const uds_ctx,
		 * Transfer length is less as requested by wLength and
		 * is multiple of wMaxPacketSize.
		 */
		LOG_DBG("add ZLP, wLength %u buf length %u",
		LOG_DBG("add ZLP, wLength %u buf length %zu",
			setup->wLength, min_len);
		udc_ep_buf_set_zlp(buf);

+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ static int init_configuration(struct usbd_contex *const uds_ctx,
			return ret;
		}

		LOG_INF("Init class node %p, descriptor length %u",
		LOG_INF("Init class node %p, descriptor length %zu",
			c_nd, usbd_class_desc_len(c_nd));
		cfg_len += usbd_class_desc_len(c_nd);
	}
Loading