Re: [PATCH 50/68] usb: gadget: renesas_usbhs: fix compile warning

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

 



Hello.

On 13-10-2011 21:56, Felipe Balbi wrote:

| drivers/usb/renesas_usbhs/fifo.c: In function ‘usbhsf_dma_prepare_push’:
| drivers/usb/renesas_usbhs/fifo.c:823:7: warning: cast from pointer \
	to integer of different size [-Wpointer-to-int-cast]
| drivers/usb/renesas_usbhs/fifo.c: In function ‘usbhsf_dma_try_pop’:
| drivers/usb/renesas_usbhs/fifo.c:900:7: warning: cast from pointer \
	to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Felipe Balbi<balbi@xxxxxx>
---
  drivers/usb/renesas_usbhs/fifo.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 16b12b0..762b742 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -820,7 +820,7 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done)
  	if (len % 4) /* 32bit alignment */
  		goto usbhsf_pio_prepare_push;

-	if (((u32)pkt->buf + pkt->actual)&  0x7) /* 8byte alignment */
+	if ((*(u32 *) pkt->buf + pkt->actual)&  0x7) /* 8byte alignment */
  		goto usbhsf_pio_prepare_push;

  	/* get enable DMA fifo */
@@ -897,7 +897,7 @@ static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done)
  	if (!fifo)
  		goto usbhsf_pio_prepare_pop;

-	if (((u32)pkt->buf + pkt->actual)&  0x7) /* 8byte alignment */
+	if ((*(u32 *) pkt->buf + pkt->actual)&  0x7) /* 8byte alignment */
  		goto usbhsf_pio_prepare_pop;

  	ret = usbhsf_fifo_select(pipe, fifo, 0);

Hm, are you sure dereferencing the pointer is correct here? It doesn't make sense to me...

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