From: Fabian Frederick <fabf@skynet.be>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
Anna Schumaker <anna.schumaker@netapp.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, fabf@skynet.be
Subject: [PATCH V2 linux-next] nfs: kmap can't fail
Date: Wed, 26 Apr 2017 20:45:16 +0200 [thread overview]
Message-ID: <20170426184516.21784-1-fabf@skynet.be> (raw)
Remove NULL test on kmap()
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
V2: Remove ptr and return kmap(page) directly
(Suggested by Anna Schumaker)
fs/nfs/dir.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 3a188cb..12ed806b 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -175,13 +175,9 @@ typedef struct {
static
struct nfs_cache_array *nfs_readdir_get_array(struct page *page)
{
- void *ptr;
if (page == NULL)
return ERR_PTR(-EIO);
- ptr = kmap(page);
- if (ptr == NULL)
- return ERR_PTR(-ENOMEM);
- return ptr;
+ return kmap(page);
}
static
--
2.9.3
next reply other threads:[~2017-04-26 18:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 18:45 Fabian Frederick [this message]
2017-04-26 19:05 ` [PATCH V2 linux-next] nfs: kmap can't fail Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170426184516.21784-1-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=anna.schumaker@netapp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).