dma-direct: simplify the use atomic pool logic in dma_direct_alloc
authorChristoph Hellwig <hch@lst.de>
Fri, 6 Oct 2023 13:13:34 +0000 (15:13 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 22 Oct 2023 14:38:54 +0000 (16:38 +0200)
commitb1da46d70e5427a9ba5eae28bcca29a20e68a442
tree8c58b5b157df317e8a0eacb734456b49794fd26d
parent2c8ed1b960fb97c82ede5afc974329bfdb457f5f
dma-direct: simplify the use atomic pool logic in dma_direct_alloc

The logic in dma_direct_alloc when to use the atomic pool vs remapping
grew a bit unreadable.  Consolidate it into a single check, and clean
up the set_uncached vs remap logic a bit as well.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
kernel/dma/direct.c