diff mbox

[1/1,linux-next] nfs: kmap can't fail

Message ID 20170425181033.1892-1-fabf@skynet.be (mailing list archive)
State New, archived
Headers show

Commit Message

Fabian Frederick April 25, 2017, 6:10 p.m. UTC
Remove NULL test on kmap()

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/nfs/dir.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Schumaker, Anna April 25, 2017, 8:37 p.m. UTC | #1
Hi Fabian,

On 04/25/2017 02:10 PM, Fabian Frederick wrote:
> Remove NULL test on kmap()
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/nfs/dir.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index 3a188cb..f89e54c 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -179,8 +179,6 @@ struct nfs_cache_array *nfs_readdir_get_array(struct page *page)
>  	if (page == NULL)
>  		return ERR_PTR(-EIO);
>  	ptr = kmap(page);
> -	if (ptr == NULL)
> -		return ERR_PTR(-ENOMEM);>  	return ptr;

While you're at it, can you remove the ptr variable entirely and change the code to "return kmap(page)" instead?

Thanks,
Anna

>  }
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 3a188cb..f89e54c 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -179,8 +179,6 @@  struct nfs_cache_array *nfs_readdir_get_array(struct page *page)
 	if (page == NULL)
 		return ERR_PTR(-EIO);
 	ptr = kmap(page);
-	if (ptr == NULL)
-		return ERR_PTR(-ENOMEM);
 	return ptr;
 }