dma-direct: refine dma_direct_alloc zone selection
authorChristoph Hellwig <hch@lst.de>
Fri, 7 Sep 2018 00:30:54 +0000 (20:30 -0400)
committerChristoph Hellwig <hch@lst.de>
Mon, 1 Oct 2018 14:28:00 +0000 (07:28 -0700)
commit7d21ee4c719f00896767ce19c4c01a56374c2ced
tree81ddf922c44d62db19a3048aa1fc0f2f1b2bdd76
parenta20bb058375147cb639c7aa17ef86ad68b32d847
dma-direct: refine dma_direct_alloc zone selection

We need to take the DMA offset and encryption bit into account when
selecting a zone.  User the opportunity to factor out the zone
selection into a helper for reuse.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
kernel/dma/direct.c