Re: [PATCH 1/1] dmaengine: stm32-dma: avoid 64-bit division in stm32_dma_get_max_width

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

 



On 03-11-21, 16:33, Amelie Delaunay wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
> 
> Using the % operator on a 64-bit variable is expensive and can
> cause a link failure:
> 
> arm-linux-gnueabi-ld: drivers/dma/stm32-dma.o: in function `stm32_dma_get_max_width':
> stm32-dma.c:(.text+0x170): undefined reference to `__aeabi_uldivmod'
> arm-linux-gnueabi-ld: drivers/dma/stm32-dma.o: in function `stm32_dma_set_xfer_param':
> stm32-dma.c:(.text+0x1cd4): undefined reference to `__aeabi_uldivmod'
> 
> As we know that we just want to check the alignment in
> stm32_dma_get_max_width(), there is no need for a full division, and
> using a simple mask is a faster replacement.
> 
> Same in stm32_dma_set_xfer_param(), change this to only allow burst
> transfers if the address is a multiple of the length.
> stm32_dma_get_best_burst just after will take buf_len into account to fix
> burst in case of misalignment.

Applied, thanks

-- 
~Vinod



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux