Re: [PATCH 3/4] usb: gadget: net2272: fix compile warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 04-07-2011 12:46, Felipe Balbi wrote:

This patch fixes the following compile warnings:

drivers/usb/gadget/net2272.c: In function ‘net2272_kick_dma’:
drivers/usb/gadget/net2272.c:740:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/usb/gadget/net2272.c: In function ‘net2272_queue’:
drivers/usb/gadget/net2272.c:859:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 8 has type ‘dma_addr_t’ [-Wformat]

Signed-off-by: Felipe Balbi<balbi@xxxxxx>
---

this, of course, will only move the warning from 64-bit to
32-bit but I see no way to make both archs happy considering
the (bogus ?) definition of dma_addr_t.

Would you be open to the following ?

diff --git a/include/linux/types.h b/include/linux/types.h
index 176da8c..d4dcd6f 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -150,11 +150,7 @@ typedef unsigned long blkcnt_t;
  #define pgoff_t unsigned long
  #endif

-#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
-typedef u64 dma_addr_t;
-#else
-typedef u32 dma_addr_t;
-#endif /* dma_addr_t */
+typedef unsigned long dma_addr_t;

  #endif /* __KERNEL__ */


or do we have any 32-bit architecture which needs 64-bit
dma_addr_t ??

   Certainly...

  drivers/usb/gadget/net2272.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index 6065bdf..da920f1 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -737,7 +737,7 @@ net2272_kick_dma(struct net2272_ep *ep, struct net2272_request *req)
  	if (req->req.length&  1)
  		return -EINVAL;

-	dev_vdbg(ep->dev->dev, "kick_dma %s req %p dma %08x\n",
+	dev_vdbg(ep->dev->dev, "kick_dma %s req %p dma %08llx\n",
  		ep->ep.name, req, req->req.dma);

   Why not cast 'req->req.dma' to 'unsigned long long'?


  	net2272_ep_write(ep, EP_RSPSET, 1<<  ALT_NAK_OUT_PACKETS);
@@ -856,7 +856,7 @@ net2272_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
  		req->mapped = 1;
  	}

-	dev_vdbg(dev->dev, "%s queue req %p, len %d buf %p dma %08x %s\n",
+	dev_vdbg(dev->dev, "%s queue req %p, len %d buf %p dma %08llx %s\n",
  		_ep->name, _req, _req->length, _req->buf,
  		_req->dma, _req->zero ? "zero" : "!zero");

   Same here...

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux