Skip to contentSkip to conversation

ci_udc: fix 64-bit compile warnings

PATCH New Stephen Warren 3 participants 6 messages Jul 22, 2015 – Jul 23, 2015 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ci_udc: fix 64-bit compile warnings

From: Stephen Warren <[email protected]>

This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more.

---
 drivers/usb/gadget/ci_udc.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/usb/gadget/ci_udc.c +10 -9
index aadff42a9cdc..993be315a8cf 100644
@@ -221,8 +221,8 @@ static void ci_flush_qtd(int ep_num)
  */
 static void ci_flush_td(struct ept_queue_item *td)
 {
-	const uint32_t  start = (uint32_t)td;
-	const uint32_t end = (uint32_t) td + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = (unsigned long)td + ILIST_ENT_SZ;
 	flush_dcache_range(start, end);
 }
 
@@ -249,8 +249,8 @@ static void ci_invalidate_qtd(int ep_num)
  */
 static void ci_invalidate_td(struct ept_queue_item *td)
 {
-	const uint32_t start = (uint32_t)td;
-	const uint32_t end = start + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = start + ILIST_ENT_SZ;
 	invalidate_dcache_range(start, end);
 }
 
@@ -459,7 +459,7 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
 		if (len) {
 			qtd = (struct ept_queue_item *)
 			       memalign(ILIST_ALIGN, ILIST_ENT_SZ);
-			dtd->next = (uint32_t)qtd;
+			dtd->next = (unsigned long)qtd;
 			dtd = qtd;
 			memset(dtd, 0, ILIST_ENT_SZ);
 		}
@@ -503,10 +503,10 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
 
 	ci_flush_qtd(num);
 
-	item = (struct ept_queue_item *)head->next;
+	item = (struct ept_queue_item *)(unsigned long)head->next;
 	while (item->next != TERMINATE) {
-		ci_flush_td((struct ept_queue_item *)item->next);
-		item = (struct ept_queue_item *)item->next;
+		ci_flush_td((struct ept_queue_item *)(unsigned long)item->next);
+		item = (struct ept_queue_item *)(unsigned long)item->next;
 	}
 
 	DBG("ept%d %s queue len %x, req %p, buffer %p\n",
@@ -594,7 +594,8 @@ static void handle_ep_complete(struct ci_ep *ci_ep)
 			printf("EP%d/%s FAIL info=%x pg0=%x\n",
 			       num, in ? "in" : "out", item->info, item->page0);
 		if (j != ci_req->dtd_count - 1)
-			next_td = (struct ept_queue_item *)item->next;
+			next_td = (struct ept_queue_item *)(unsigned long)
+				item->next;
 		if (j != 0)
 			free(item);
 	}
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/1 ci_udc: fix 64-bit compile warnings

In reply to Stephen Warren

Hi Marek,

Quoted 70 lines

From: Stephen Warren <[email protected]>

This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more.

---
 drivers/usb/gadget/ci_udc.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/usb/gadget/ci_udc.c +8 -8
index aadff42a9cdc..993be315a8cf 100644
@@ -221,8 +221,8 @@ static void ci_flush_qtd(int ep_num)
  */
 static void ci_flush_td(struct ept_queue_item *td)
 {
-	const uint32_t  start = (uint32_t)td;
-	const uint32_t end = (uint32_t) td + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = (unsigned long)td + ILIST_ENT_SZ;
 	flush_dcache_range(start, end);
 }
 
@@ -249,8 +249,8 @@ static void ci_invalidate_qtd(int ep_num)
  */
 static void ci_invalidate_td(struct ept_queue_item *td)
 {
-	const uint32_t start = (uint32_t)td;
-	const uint32_t end = start + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = start + ILIST_ENT_SZ;
 	invalidate_dcache_range(start, end);
 }
 
@@ -459,7 +459,7 @@ static void ci_ep_submit_next_request(struct
 ci_ep *ci_ep) if (len) {
 			qtd = (struct ept_queue_item *)
 			       memalign(ILIST_ALIGN, ILIST_ENT_SZ);
-			dtd->next = (uint32_t)qtd;
+			dtd->next = (unsigned long)qtd;
 			dtd = qtd;
 			memset(dtd, 0, ILIST_ENT_SZ);
 		}
@@ -503,10 +503,10 @@ static void ci_ep_submit_next_request(struct
 ci_ep *ci_ep) 
 	ci_flush_qtd(num);
 
-	item = (struct ept_queue_item *)head->next;
+	item = (struct ept_queue_item *)(unsigned long)head->next;
 	while (item->next != TERMINATE) {
-		ci_flush_td((struct ept_queue_item *)item->next);
-		item = (struct ept_queue_item *)item->next;
+		ci_flush_td((struct ept_queue_item *)(unsigned
 long)item->next);
+		item = (struct ept_queue_item *)(unsigned
 long)item->next; }
 
drivers/usb/gadget/ci_udc.c +2 -1
 	DBG("ept%d %s queue len %x, req %p, buffer %p\n",
@@ -594,7 +594,8 @@ static void handle_ep_complete(struct ci_ep
 *ci_ep) printf("EP%d/%s FAIL info=%x pg0=%x\n",
 			       num, in ? "in" : "out", item->info,
 item->page0); if (j != ci_req->dtd_count - 1)
-			next_td = (struct ept_queue_item
 *)item->next;
+			next_td = (struct ept_queue_item *)(unsigned
 long)
+				item->next;
 		if (j != 0)

drivers/usb/gadget/ci_udc.c static void handle_ep_complete(struct ci_ep *ci_ep) · line 601

Quoted 2 lines
drivers/usb/gadget/ci_udc.c +0 -0
 			free(item);
 	}

Should I take the patch to -dfu tree?

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#3 lore raw

PATCH 1/1 ci_udc: fix 64-bit compile warnings

Quoted 95 lines · Lukasz Majewski

Hi Marek,

Quoted 93 lines

From: Stephen Warren <[email protected]>

This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more.

---

 drivers/usb/gadget/ci_udc.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/usb/gadget/ci_udc.c +2 -2
index aadff42a9cdc..993be315a8cf 100644
@@ -221,8 +221,8 @@ static void ci_flush_qtd(int ep_num)
 
  */
 
 static void ci_flush_td(struct ept_queue_item *td)
 {
 
-	const uint32_t  start = (uint32_t)td;
-	const uint32_t end = (uint32_t) td + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = (unsigned long)td + ILIST_ENT_SZ;
drivers/usb/gadget/ci_udc.c +2 -2
 	flush_dcache_range(start, end);
 
 }
@@ -249,8 +249,8 @@ static void ci_invalidate_qtd(int ep_num)
 
  */
 
 static void ci_invalidate_td(struct ept_queue_item *td)
 {
 
-	const uint32_t start = (uint32_t)td;
-	const uint32_t end = start + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = start + ILIST_ENT_SZ;
drivers/usb/gadget/ci_udc.c +1 -1
 	invalidate_dcache_range(start, end);
 
 }
@@ -459,7 +459,7 @@ static void ci_ep_submit_next_request(struct
 ci_ep *ci_ep) if (len) {
 
 			qtd = (struct ept_queue_item *)
 
 			       memalign(ILIST_ALIGN, ILIST_ENT_SZ);
 
-			dtd->next = (uint32_t)qtd;
+			dtd->next = (unsigned long)qtd;
drivers/usb/gadget/ci_udc.c +2 -3
 			dtd = qtd;
 			memset(dtd, 0, ILIST_ENT_SZ);
 
 		}
@@ -503,10 +503,10 @@ static void ci_ep_submit_next_request(struct
 ci_ep *ci_ep)
 
 	ci_flush_qtd(num);
 
-	item = (struct ept_queue_item *)head->next;
+	item = (struct ept_queue_item *)(unsigned long)head->next;
 
 	while (item->next != TERMINATE) {
 
-		ci_flush_td((struct ept_queue_item *)item->next);
-		item = (struct ept_queue_item *)item->next;
+		ci_flush_td((struct ept_queue_item *)(unsigned

long)item->next);

drivers/usb/gadget/ci_udc.c +1 -0
+		item = (struct ept_queue_item *)(unsigned

long)item->next; }

drivers/usb/gadget/ci_udc.c +1 -1
 	DBG("ept%d %s queue len %x, req %p, buffer %p\n",
@@ -594,7 +594,8 @@ static void handle_ep_complete(struct ci_ep
 *ci_ep) printf("EP%d/%s FAIL info=%x pg0=%x\n",
 
 			       num, in ? "in" : "out", item->info,
 
 item->page0); if (j != ci_req->dtd_count - 1)
-			next_td = (struct ept_queue_item
 *)item->next;
+			next_td = (struct ept_queue_item *)(unsigned

long)

drivers/usb/gadget/ci_udc.c +1 -0
+				item->next;
Quoted 7 lines

drivers/usb/gadget/ci_udc.c static void handle_ep_complete(struct ci_ep *ci_ep) · line 601

Quoted 5 lines
drivers/usb/gadget/ci_udc.c +0 -0
 		if (j != 0)
 
 			free(item);
 
 	}

Should I take the patch to -dfu tree?

I picked it for -usb . I will wait until the weekend, then build and send a PR to Tom.

#4 lore raw

PATCH 1/1 ci_udc: fix 64-bit compile warnings

In reply to Stephen Warren

Hi Marek,

Quoted 5 lines

From: Stephen Warren <[email protected]>

This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more.

Never mind :-). It is already in your tree. Sorry for the noise.

Quoted 67 lines
---
 drivers/usb/gadget/ci_udc.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/usb/gadget/ci_udc.c +8 -8
index aadff42a9cdc..993be315a8cf 100644
@@ -221,8 +221,8 @@ static void ci_flush_qtd(int ep_num)
  */
 static void ci_flush_td(struct ept_queue_item *td)
 {
-	const uint32_t  start = (uint32_t)td;
-	const uint32_t end = (uint32_t) td + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = (unsigned long)td + ILIST_ENT_SZ;
 	flush_dcache_range(start, end);
 }
 
@@ -249,8 +249,8 @@ static void ci_invalidate_qtd(int ep_num)
  */
 static void ci_invalidate_td(struct ept_queue_item *td)
 {
-	const uint32_t start = (uint32_t)td;
-	const uint32_t end = start + ILIST_ENT_SZ;
+	const unsigned long start = (unsigned long)td;
+	const unsigned long end = start + ILIST_ENT_SZ;
 	invalidate_dcache_range(start, end);
 }
 
@@ -459,7 +459,7 @@ static void ci_ep_submit_next_request(struct
 ci_ep *ci_ep) if (len) {
 			qtd = (struct ept_queue_item *)
 			       memalign(ILIST_ALIGN, ILIST_ENT_SZ);
-			dtd->next = (uint32_t)qtd;
+			dtd->next = (unsigned long)qtd;
 			dtd = qtd;
 			memset(dtd, 0, ILIST_ENT_SZ);
 		}
@@ -503,10 +503,10 @@ static void ci_ep_submit_next_request(struct
 ci_ep *ci_ep) 
 	ci_flush_qtd(num);
 
-	item = (struct ept_queue_item *)head->next;
+	item = (struct ept_queue_item *)(unsigned long)head->next;
 	while (item->next != TERMINATE) {
-		ci_flush_td((struct ept_queue_item *)item->next);
-		item = (struct ept_queue_item *)item->next;
+		ci_flush_td((struct ept_queue_item *)(unsigned
 long)item->next);
+		item = (struct ept_queue_item *)(unsigned
 long)item->next; }
 
drivers/usb/gadget/ci_udc.c +2 -1
 	DBG("ept%d %s queue len %x, req %p, buffer %p\n",
@@ -594,7 +594,8 @@ static void handle_ep_complete(struct ci_ep
 *ci_ep) printf("EP%d/%s FAIL info=%x pg0=%x\n",
 			       num, in ? "in" : "out", item->info,
 item->page0); if (j != ci_req->dtd_count - 1)
-			next_td = (struct ept_queue_item
 *)item->next;
+			next_td = (struct ept_queue_item *)(unsigned
 long)
+				item->next;
 		if (j != 0)
drivers/usb/gadget/ci_udc.c +0 -0
 			free(item);
 	}
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#5 lore raw

PATCH 1/1 ci_udc: fix 64-bit compile warnings

Quoted 8 lines · Lukasz Majewski

Hi Marek,

Quoted 4 lines

From: Stephen Warren <[email protected]>

This is the same as f72d8320b605 "usb: ci_udc: fix warnings on 64-bit builds", but more.

Never mind :-). It is already in your tree. Sorry for the noise.

No worries :)

Best regards,
Marek Vasut