Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320837
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 7/7] usb: musb/ux500: remove duplicate check for dma_is_compatible |
| Date | 2016-01-28 17:30 +0100 |
| Message-ID | <qVXCh-61u-1@gated-at.bofh.it> (permalink) |
| References | <qVXsB-5Xs-5@gated-at.bofh.it> <qVXCh-61u-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
When dma_addr_t is 64-bit, we get a warning about an invalid cast in the call to ux500_dma_is_compatible() from ux500_dma_channel_program(): drivers/usb/musb/ux500_dma.c: In function 'ux500_dma_channel_program': drivers/usb/musb/ux500_dma.c:210:51: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len)) The problem is that ux500_dma_is_compatible() is called from the main musb driver on the virtual address, but here we pass in a DMA address, so the types are fundamentally different but it works because the function only checks the alignment of the buffer and that is the same. We could work around this by adding another cast, but I have checked that the buffer we get passed here is already checked before it gets mapped, so the second check seems completely unnecessary and removing it must be the cleanest solution. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/usb/musb/ux500_dma.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index d0b6a1cd7f62..c92a295049ad 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -207,9 +207,6 @@ static int ux500_dma_channel_program(struct dma_channel *channel, BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN || channel->status == MUSB_DMA_STATUS_BUSY); - if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len)) - return false; - channel->status = MUSB_DMA_STATUS_BUSY; channel->actual_len = 0; ret = ux500_configure_channel(channel, packet_sz, mode, dma_addr, len); -- 2.7.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] USB changes for rare warnings Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:20 +0100
[PATCH 1/7] usb: gadget: pxa25x_udc: move register definitions from arch Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:20 +0100
[PATCH 2/7] usb: gadget: pxa25x_udc cleanup Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:20 +0100
Re: [PATCH 2/7] usb: gadget: pxa25x_udc cleanup Robert Jarzmik <robert.jarzmik@free.fr> - 2016-01-29 11:20 +0100
Re: [PATCH 1/7] usb: gadget: pxa25x_udc: move register definitions from arch Robert Jarzmik <robert.jarzmik@free.fr> - 2016-01-29 10:40 +0100
Re: [PATCH 1/7] usb: gadget: pxa25x_udc: move register definitions from arch Arnd Bergmann <arnd@arndb.de> - 2016-01-29 11:10 +0100
Re: [PATCH 1/7] usb: gadget: pxa25x_udc: move register definitions from arch Robert Jarzmik <robert.jarzmik@free.fr> - 2016-01-29 16:30 +0100
Re: [PATCH 1/7] usb: gadget: pxa25x_udc: move register definitions from arch khalasa@piap.pl (Krzysztof Hałasa) - 2016-01-29 17:10 +0100
[PATCH 7/7] usb: musb/ux500: remove duplicate check for dma_is_compatible Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:30 +0100
[PATCH 5/7] usb: isp1301-omap: mark power_up as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:30 +0100
[PATCH 6/7] usb: musb: use %pad format string from dma_addr_t Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:30 +0100
Re: [PATCH 6/7] usb: musb: use %pad format string from dma_addr_t Tony Lindgren <tony@atomide.com> - 2016-01-28 19:00 +0100
[PATCH 4/7] usb: fsl: drop USB_FSL_MPH_DR_OF Kconfig symbol Arnd Bergmann <arnd@arndb.de> - 2016-01-28 17:30 +0100
Re: [PATCH 0/7] USB changes for rare warnings Felipe Balbi <balbi@kernel.org> - 2016-02-03 19:20 +0100
Re: [PATCH 0/7] USB changes for rare warnings Robert Jarzmik <robert.jarzmik@free.fr> - 2016-02-03 20:20 +0100
Re: [PATCH 0/7] USB changes for rare warnings Arnd Bergmann <arnd@arndb.de> - 2016-02-03 22:00 +0100
csiph-web