diff mbox series

[08/12] dma-direct: use phys_to_dma_direct in dma_direct_alloc

Message ID 20200908164758.3177341-9-hch@lst.de (mailing list archive)
State Superseded
Headers show
Series [01/12] MIPS: make dma_sync_*_for_cpu a little less overzealous | expand

Commit Message

Christoph Hellwig Sept. 8, 2020, 4:47 p.m. UTC
Replace the currently open code copy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 kernel/dma/direct.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Robin Murphy Sept. 10, 2020, 1:03 p.m. UTC | #1
On 2020-09-08 17:47, Christoph Hellwig wrote:
> Replace the currently open code copy.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   kernel/dma/direct.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
> index 12e9f5f75dfe4b..57a6e7d7cf8f16 100644
> --- a/kernel/dma/direct.c
> +++ b/kernel/dma/direct.c
> @@ -240,10 +240,7 @@ void *dma_direct_alloc(struct device *dev, size_t size,
>   			goto out_encrypt_pages;
>   	}
>   done:
> -	if (force_dma_unencrypted(dev))
> -		*dma_handle = __phys_to_dma(dev, page_to_phys(page));
> -	else
> -		*dma_handle = phys_to_dma(dev, page_to_phys(page));
> +	*dma_handle = phys_to_dma_direct(dev, page_to_phys(page));
>   	return ret;
>   
>   out_encrypt_pages:
>
diff mbox series

Patch

diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 12e9f5f75dfe4b..57a6e7d7cf8f16 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -240,10 +240,7 @@  void *dma_direct_alloc(struct device *dev, size_t size,
 			goto out_encrypt_pages;
 	}
 done:
-	if (force_dma_unencrypted(dev))
-		*dma_handle = __phys_to_dma(dev, page_to_phys(page));
-	else
-		*dma_handle = phys_to_dma(dev, page_to_phys(page));
+	*dma_handle = phys_to_dma_direct(dev, page_to_phys(page));
 	return ret;
 
 out_encrypt_pages: