diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-08 18:56:22 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-09-11 10:14:25 +0300 |
commit | 7bc5c428a660d4d1bc95ba54bf4cb6bccf8c3029 (patch) | |
tree | 306eb3d7befdec2da08f45e88e2dd2aaf6e5a5a1 /kernel/dma/direct.c | |
parent | 96eb89caf753fd0c26d239d8483d92632fb5be15 (diff) | |
download | linux-7bc5c428a660d4d1bc95ba54bf4cb6bccf8c3029.tar.xz |
dma-direct: remove __dma_to_phys
There is no harm in just always clearing the SME encryption bit, while
significantly simplifying the interface.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Diffstat (limited to 'kernel/dma/direct.c')
-rw-r--r-- | kernel/dma/direct.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index 57a6e7d7cf8f..bfb479c8a370 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -48,11 +48,6 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 dma_mask, { u64 dma_limit = min_not_zero(dma_mask, dev->bus_dma_limit); - if (force_dma_unencrypted(dev)) - *phys_limit = __dma_to_phys(dev, dma_limit); - else - *phys_limit = dma_to_phys(dev, dma_limit); - /* * Optimistically try the zone that the physical address mask falls * into first. If that returns memory that isn't actually addressable @@ -61,6 +56,7 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 dma_mask, * Note that GFP_DMA32 and GFP_DMA are no ops without the corresponding * zones. */ + *phys_limit = dma_to_phys(dev, dma_limit); if (*phys_limit <= DMA_BIT_MASK(zone_dma_bits)) return GFP_DMA; if (*phys_limit <= DMA_BIT_MASK(32)) |