OSDN Git Service

dmaengine: stm32-dmamux: Simplify code and save a few bytes of memory
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 30 Jul 2022 20:07:45 +0000 (22:07 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Sep 2022 06:22:28 +0000 (11:52 +0530)
commit8c79fd35e1e793361ed30eaa79b3c5752e6c69fb
tree6e8fc6696e3475cb1174c57cef20a5fa7504d6bc
parente1c9832b0964327399d43dc481a8c85285b23ad5
dmaengine: stm32-dmamux: Simplify code and save a few bytes of memory

STM32_DMAMUX_MAX_DMA_REQUESTS is small (i.e. 32) and when the 'dma_inuse'
bitmap is allocated, there is already a check that 'dma_req' is <= this
limit.

So, there is no good reason to dynamically allocate this bitmap. This
just waste some memory and some cycles.

Use DECLARE_BITMAP with the maximum bitmap size instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/2d8c24359b2daa32ce0597a2949b7b2bebaf23de.1659211633.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32-dmamux.c