David Brownell wrote:
On Tuesday 12 October 2004 9:51 am, Randy Dunlap wrote:

This is on x86-64.  Matter or don't care?  IOW, is net2280 its own
gadget processor, so building on a 64-bit host isn't valid?


All warnings should vanish ... feel free to make a patch to
fix these!

Agreed. 8:)

This is a chip that can be wired onto any PCI bus, and it's
also available on add-in PCI cards.  No reason the driver
shouldn't be clean w.r.t. 64/32/N bit words, endianness, etc.

Are net2280 dma addresses always 32-bit (internally), or does it depend on the host system? Are fields always little-endian internally?

drivers/usb/gadget/net2280.c: In function `fill_dma_desc':
drivers/usb/gadget/net2280.c:718: warning: passing arg 1 of
`__cpu_to_le32p' from incompatible pointer type

Could mark req.dma as __le32...

I didn't like that suggestion (yet), other people can comment on it, though. For now I'm just adding a cast.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/net2280.c: In function `show_queues':
drivers/usb/gadget/net2280.c:1704: warning: unsigned int format,
different type arg (arg 4)

Common kernel practice for printing a dma_addr_t is to cast it to
unsigned long long, which needs %16llx.

I made this one %*llx so that '*' can be variable-sized, depending on host arch.

Comments?


-- ~Randy
Fix gcc warnings in net2280:

drivers/usb/gadget/net2280.c:718: warning: passing arg 1 of `__cpu_to_le32p' from incompatible pointer type
drivers/usb/gadget/net2280.c:1704: warning: unsigned int format, different type arg (arg 4)

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>


diffstat:=
 drivers/usb/gadget/net2280.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -Naurp ./drivers/usb/gadget/net2280.c~net2280_printk ./drivers/usb/gadget/net2280.c
--- ./drivers/usb/gadget/net2280.c~net2280_printk	2004-10-11 21:18:00.000000000 -0700
+++ ./drivers/usb/gadget/net2280.c	2004-10-14 10:41:34.802776448 -0700
@@ -715,7 +715,7 @@ fill_dma_desc (struct net2280_ep *ep, st
 		dmacount |= (1 << DMA_DONE_INTERRUPT_ENABLE);
 
 	/* td->dmadesc = previously set by caller */
-	td->dmaaddr = cpu_to_le32p (&req->req.dma);
+	td->dmaaddr = cpu_to_le32p ((__le32 *)(&req->req.dma));
 
 	/* 2280 may be polling VALID_BIT through ep->dma->dmadesc */
 	wmb ();
@@ -1698,10 +1698,12 @@ show_queues (struct device *_dev, char *
 				struct net2280_dma	*td;
 
 				td = req->td;
-				t = scnprintf (next, size, "\t    td %08x "
+				t = scnprintf (next, size, "\t    td %*llx "
 					" count %08x buf %08x desc %08x\n",
-					req->td_dma, td->dmacount,
-					td->dmaaddr, td->dmadesc);
+					(int)(2 * sizeof(unsigned long long)),
+					(unsigned long long)req->td_dma,
+					td->dmacount, td->dmaaddr,
+					td->dmadesc);
 				if (t <= 0 || t > size)
 					goto done;
 				size -= t;

Reply via email to