diff mbox

[2/5] drm/armada: use shmem helpers if possible

Message ID 1401021252-29006-2-git-send-email-dh.herrmann@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Herrmann May 25, 2014, 12:34 p.m. UTC
shmem_read_mapping_page() uses mapping_gfp_mask(mapping) as default gfp
mask. No reason to use shmem_read_mapping_page_gfp() directly if we want
the default behavior.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
 drivers/gpu/drm/armada/armada_gem.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Russell King - ARM Linux May 25, 2014, 10:56 p.m. UTC | #1
On Sun, May 25, 2014 at 02:34:09PM +0200, David Herrmann wrote:
> shmem_read_mapping_page() uses mapping_gfp_mask(mapping) as default gfp
> mask. No reason to use shmem_read_mapping_page_gfp() directly if we want
> the default behavior.
> 
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>

Nothing obviously wrong and looks sane enough.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

Thanks.

Airlied, can you take this one as well please?  Thanks.

> ---
>  drivers/gpu/drm/armada/armada_gem.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
> index 887816f..bb9b642 100644
> --- a/drivers/gpu/drm/armada/armada_gem.c
> +++ b/drivers/gpu/drm/armada/armada_gem.c
> @@ -433,7 +433,6 @@ armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
>  
>  	if (dobj->obj.filp) {
>  		struct address_space *mapping;
> -		gfp_t gfp;
>  		int count;
>  
>  		count = dobj->obj.size / PAGE_SIZE;
> @@ -441,12 +440,11 @@ armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
>  			goto free_sgt;
>  
>  		mapping = file_inode(dobj->obj.filp)->i_mapping;
> -		gfp = mapping_gfp_mask(mapping);
>  
>  		for_each_sg(sgt->sgl, sg, count, i) {
>  			struct page *page;
>  
> -			page = shmem_read_mapping_page_gfp(mapping, i, gfp);
> +			page = shmem_read_mapping_page(mapping, i);
>  			if (IS_ERR(page)) {
>  				num = i;
>  				goto release;
> -- 
> 1.9.3
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index 887816f..bb9b642 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -433,7 +433,6 @@  armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
 
 	if (dobj->obj.filp) {
 		struct address_space *mapping;
-		gfp_t gfp;
 		int count;
 
 		count = dobj->obj.size / PAGE_SIZE;
@@ -441,12 +440,11 @@  armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
 			goto free_sgt;
 
 		mapping = file_inode(dobj->obj.filp)->i_mapping;
-		gfp = mapping_gfp_mask(mapping);
 
 		for_each_sg(sgt->sgl, sg, count, i) {
 			struct page *page;
 
-			page = shmem_read_mapping_page_gfp(mapping, i, gfp);
+			page = shmem_read_mapping_page(mapping, i);
 			if (IS_ERR(page)) {
 				num = i;
 				goto release;