From: "Jianpeng Ma" <majianpeng@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().
Date: Sat, 15 Sep 2012 10:43:00 +0800 [thread overview]
Message-ID: <2012091510425793786613@gmail.com> (raw)
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
drivers/md/bitmap.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 94e7f6b..f03ad11 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -476,11 +476,8 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
int err = -EINVAL;
bitmap->storage.sb_page = alloc_page(GFP_KERNEL);
- if (IS_ERR(bitmap->storage.sb_page)) {
- err = PTR_ERR(bitmap->storage.sb_page);
- bitmap->storage.sb_page = NULL;
- return err;
- }
+ if (bitmap->storage.sb_page == NULL)
+ return -ENOMEM;
bitmap->storage.sb_page->index = 0;
sb = kmap_atomic(bitmap->storage.sb_page);
--
1.7.9.5
next reply other threads:[~2012-09-15 2:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-15 2:43 Jianpeng Ma [this message]
2012-09-20 2:54 ` [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page() NeilBrown
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=2012091510425793786613@gmail.com \
--to=majianpeng@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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).