linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: mtu3: fix dma_addr_t printk output again
@ 2017-11-02 14:30 Arnd Bergmann
  2017-11-02 15:38 ` Felipe Balbi
  2017-11-02 23:54 ` Chunfeng Yun
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-11-02 14:30 UTC (permalink / raw)
  To: Felipe Balbi, Chunfeng Yun, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Sudip Mukherjee, linux-usb, linux-arm-kernel,
	linux-mediatek, linux-kernel

The support for 36-bit addresses originally came with an incorrect
printk format for dma addresses. Felipe changed the format string it
while applying, but the result was still incorrect, since we now have
to pass a pointer to the address instead of the integer value:

drivers/usb/mtu3/mtu3_qmu.c: In function 'mtu3_prepare_tx_gpd':
drivers/usb/mtu3/mtu3_qmu.c:261:25: error: format '%p' expects argument of type 'void *', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
drivers/usb/mtu3/mtu3_qmu.c: In function 'mtu3_prepare_rx_gpd':
drivers/usb/mtu3/mtu3_qmu.c:300:25: error: format '%p' expects argument of type 'void *', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]

This fixes the printk argument accordingly.

Fixes: 1a46dfea0841 ("usb: mtu3: support 36-bit DMA address")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/mtu3/mtu3_qmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c
index 42145a3f1422..0b4b412b1d0d 100644
--- a/drivers/usb/mtu3/mtu3_qmu.c
+++ b/drivers/usb/mtu3/mtu3_qmu.c
@@ -259,7 +259,7 @@ static int mtu3_prepare_tx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
 	enq = advance_enq_gpd(ring);
 	enq_dma = gpd_virt_to_dma(ring, enq);
 	dev_dbg(mep->mtu->dev, "TX-EP%d queue gpd=%p, enq=%p, qdma=%pad\n",
-		mep->epnum, gpd, enq, enq_dma);
+		mep->epnum, gpd, enq, &enq_dma);
 
 	enq->flag &= ~GPD_FLAGS_HWO;
 	gpd->next_gpd = cpu_to_le32(lower_32_bits(enq_dma));
@@ -298,7 +298,7 @@ static int mtu3_prepare_rx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
 	enq = advance_enq_gpd(ring);
 	enq_dma = gpd_virt_to_dma(ring, enq);
 	dev_dbg(mep->mtu->dev, "RX-EP%d queue gpd=%p, enq=%p, qdma=%pad\n",
-		mep->epnum, gpd, enq, enq_dma);
+		mep->epnum, gpd, enq, &enq_dma);
 
 	enq->flag &= ~GPD_FLAGS_HWO;
 	gpd->next_gpd = cpu_to_le32(lower_32_bits(enq_dma));
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: mtu3: fix dma_addr_t printk output again
  2017-11-02 14:30 [PATCH] usb: mtu3: fix dma_addr_t printk output again Arnd Bergmann
@ 2017-11-02 15:38 ` Felipe Balbi
  2017-11-02 23:54 ` Chunfeng Yun
  1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2017-11-02 15:38 UTC (permalink / raw)
  To: Arnd Bergmann, Chunfeng Yun, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Sudip Mukherjee, linux-usb, linux-arm-kernel,
	linux-mediatek, linux-kernel


Hi,

Arnd Bergmann <arnd@arndb.de> writes:
> The support for 36-bit addresses originally came with an incorrect
> printk format for dma addresses. Felipe changed the format string it
> while applying, but the result was still incorrect, since we now have
> to pass a pointer to the address instead of the integer value:
>
> drivers/usb/mtu3/mtu3_qmu.c: In function 'mtu3_prepare_tx_gpd':
> drivers/usb/mtu3/mtu3_qmu.c:261:25: error: format '%p' expects argument of type 'void *', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> drivers/usb/mtu3/mtu3_qmu.c: In function 'mtu3_prepare_rx_gpd':
> drivers/usb/mtu3/mtu3_qmu.c:300:25: error: format '%p' expects argument of type 'void *', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
>
> This fixes the printk argument accordingly.
>
> Fixes: 1a46dfea0841 ("usb: mtu3: support 36-bit DMA address")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

oh, so it wants a pointer afterall :-)

sorry.

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>

-- 
balbi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: mtu3: fix dma_addr_t printk output again
  2017-11-02 14:30 [PATCH] usb: mtu3: fix dma_addr_t printk output again Arnd Bergmann
  2017-11-02 15:38 ` Felipe Balbi
@ 2017-11-02 23:54 ` Chunfeng Yun
  1 sibling, 0 replies; 3+ messages in thread
From: Chunfeng Yun @ 2017-11-02 23:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Felipe Balbi, Greg Kroah-Hartman, Sudip Mukherjee, linux-usb,
	linux-arm-kernel, linux-mediatek, linux-kernel

hi,
On Thu, 2017-11-02 at 15:30 +0100, Arnd Bergmann wrote:
> The support for 36-bit addresses originally came with an incorrect
> printk format for dma addresses. Felipe changed the format string it
> while applying, but the result was still incorrect, since we now have
> to pass a pointer to the address instead of the integer value:
> 
> drivers/usb/mtu3/mtu3_qmu.c: In function 'mtu3_prepare_tx_gpd':
> drivers/usb/mtu3/mtu3_qmu.c:261:25: error: format '%p' expects argument of type 'void *', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> drivers/usb/mtu3/mtu3_qmu.c: In function 'mtu3_prepare_rx_gpd':
> drivers/usb/mtu3/mtu3_qmu.c:300:25: error: format '%p' expects argument of type 'void *', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> 
> This fixes the printk argument accordingly.
> 
> Fixes: 1a46dfea0841 ("usb: mtu3: support 36-bit DMA address")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/usb/mtu3/mtu3_qmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c
> index 42145a3f1422..0b4b412b1d0d 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -259,7 +259,7 @@ static int mtu3_prepare_tx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
>  	enq = advance_enq_gpd(ring);
>  	enq_dma = gpd_virt_to_dma(ring, enq);
>  	dev_dbg(mep->mtu->dev, "TX-EP%d queue gpd=%p, enq=%p, qdma=%pad\n",
> -		mep->epnum, gpd, enq, enq_dma);
> +		mep->epnum, gpd, enq, &enq_dma);
>  
>  	enq->flag &= ~GPD_FLAGS_HWO;
>  	gpd->next_gpd = cpu_to_le32(lower_32_bits(enq_dma));
> @@ -298,7 +298,7 @@ static int mtu3_prepare_rx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
>  	enq = advance_enq_gpd(ring);
>  	enq_dma = gpd_virt_to_dma(ring, enq);
>  	dev_dbg(mep->mtu->dev, "RX-EP%d queue gpd=%p, enq=%p, qdma=%pad\n",
> -		mep->epnum, gpd, enq, enq_dma);
> +		mep->epnum, gpd, enq, &enq_dma);
>  
>  	enq->flag &= ~GPD_FLAGS_HWO;
>  	gpd->next_gpd = cpu_to_le32(lower_32_bits(enq_dma));

Thanks.

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-02 23:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 14:30 [PATCH] usb: mtu3: fix dma_addr_t printk output again Arnd Bergmann
2017-11-02 15:38 ` Felipe Balbi
2017-11-02 23:54 ` Chunfeng Yun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).