All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent
@ 2018-02-05 14:54 Tom Rini
  2018-02-05 14:56 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom Rini @ 2018-02-05 14:54 UTC (permalink / raw)
  To: u-boot

In most places in the code we cast this to an unsigned long, but in one
place we cast to an unsigned int.  For consistency and to fix a warning
on 64bit targets, always cast this to unsigned long.  For the long term
we should however change the declaration of dma_buf.

Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
index b6164afa9245..57dbbd5ebfa1 100644
--- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
@@ -114,7 +114,7 @@ static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req)
 				(unsigned long) ep->dma_buf +
 				ROUND(ep->len, CONFIG_SYS_CACHELINE_SIZE));
 
-	writel((unsigned int) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
+	writel((unsigned long) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
 	writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),
 	       &reg->out_endp[ep_num].doeptsiz);
 	writel(DEPCTL_EPENA|DEPCTL_CNAK|ctrl, &reg->out_endp[ep_num].doepctl);
-- 
2.7.4

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

* [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent
  2018-02-05 14:54 [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent Tom Rini
@ 2018-02-05 14:56 ` Marek Vasut
  2018-02-05 17:09 ` Lukasz Majewski
  2018-02-05 21:47 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2018-02-05 14:56 UTC (permalink / raw)
  To: u-boot

On 02/05/2018 03:54 PM, Tom Rini wrote:
> In most places in the code we cast this to an unsigned long, but in one
> place we cast to an unsigned int.  For consistency and to fix a warning
> on 64bit targets, always cast this to unsigned long.  For the long term
> we should however change the declaration of dma_buf.
> 
> Cc: Lukasz Majewski <lukma@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> index b6164afa9245..57dbbd5ebfa1 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> @@ -114,7 +114,7 @@ static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req)
>  				(unsigned long) ep->dma_buf +
>  				ROUND(ep->len, CONFIG_SYS_CACHELINE_SIZE));
>  
> -	writel((unsigned int) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
> +	writel((unsigned long) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
>  	writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),
>  	       &reg->out_endp[ep_num].doeptsiz);
>  	writel(DEPCTL_EPENA|DEPCTL_CNAK|ctrl, &reg->out_endp[ep_num].doepctl);
> 

Acked-by: Marek Vasut <marex@denx.de>

-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent
  2018-02-05 14:54 [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent Tom Rini
  2018-02-05 14:56 ` Marek Vasut
@ 2018-02-05 17:09 ` Lukasz Majewski
  2018-02-05 21:47 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Lukasz Majewski @ 2018-02-05 17:09 UTC (permalink / raw)
  To: u-boot

On Mon,  5 Feb 2018 09:54:51 -0500
Tom Rini <trini@konsulko.com> wrote:

> In most places in the code we cast this to an unsigned long, but in
> one place we cast to an unsigned int.  For consistency and to fix a
> warning on 64bit targets, always cast this to unsigned long.  For the
> long term we should however change the declaration of dma_buf.
> 
> Cc: Lukasz Majewski <lukma@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c index
> b6164afa9245..57dbbd5ebfa1 100644 ---
> a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +++
> b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c @@ -114,7 +114,7 @@
> static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req)
> (unsigned long) ep->dma_buf + ROUND(ep->len,
> CONFIG_SYS_CACHELINE_SIZE)); 
> -	writel((unsigned int) ep->dma_buf,
> &reg->out_endp[ep_num].doepdma);
> +	writel((unsigned long) ep->dma_buf,
> &reg->out_endp[ep_num].doepdma); writel(DOEPT_SIZ_PKT_CNT(pktcnt) |
> DOEPT_SIZ_XFER_SIZE(length), &reg->out_endp[ep_num].doeptsiz);
>  	writel(DEPCTL_EPENA|DEPCTL_CNAK|ctrl,
> &reg->out_endp[ep_num].doepctl);

Acked-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180205/0ba47a6f/attachment.sig>

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

* [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent
  2018-02-05 14:54 [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent Tom Rini
  2018-02-05 14:56 ` Marek Vasut
  2018-02-05 17:09 ` Lukasz Majewski
@ 2018-02-05 21:47 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2018-02-05 21:47 UTC (permalink / raw)
  To: u-boot

On Mon, Feb 05, 2018 at 09:54:51AM -0500, Tom Rini wrote:

> In most places in the code we cast this to an unsigned long, but in one
> place we cast to an unsigned int.  For consistency and to fix a warning
> on 64bit targets, always cast this to unsigned long.  For the long term
> we should however change the declaration of dma_buf.
> 
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Acked-by: Lukasz Majewski <lukma@denx.de>
> Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180205/474df1a3/attachment.sig>

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

end of thread, other threads:[~2018-02-05 21:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 14:54 [U-Boot] [PATCH] usb: dwc2: make casts of ep->dma_buf consistent Tom Rini
2018-02-05 14:56 ` Marek Vasut
2018-02-05 17:09 ` Lukasz Majewski
2018-02-05 21:47 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.