]> Gentwo Git Trees - linux/.git/commit
dma-direct: clean up the logic in __dma_direct_alloc_pages()
authorPetr Tesarik <ptesarik@suse.com>
Thu, 10 Jul 2025 08:38:29 +0000 (10:38 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 11 Aug 2025 09:28:04 +0000 (11:28 +0200)
commit9f683dfe8099639f9ac859287744a9ed1c3698a0
tree80941475f605bb3b01d9b0f0f1117b7c48c34afb
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
dma-direct: clean up the logic in __dma_direct_alloc_pages()

Convert a goto-based loop to a while() loop. To allow the simplification,
return early when allocation from CMA is successful. As a bonus, this early
return avoids a repeated dma_coherent_ok() check.

No functional change.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20250710083829.1853466-1-ptesarik@suse.com
kernel/dma/direct.c