[PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().

Subsystems: the rest

STALE5079d

2 messages, 2 authors, 2012-09-20 · open the first message on its own page

[PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().

From: Jianpeng Ma <hidden>
Date: 2012-09-15 02:43:00

Signed-off-by: Jianpeng Ma <redacted>
---
 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

Re: [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().

From: NeilBrown <hidden>
Date: 2012-09-20 02:54:40

On Sat, 15 Sep 2012 10:43:00 +0800 "Jianpeng Ma" [off-list ref] wrote:
quoted hunk
Signed-off-by: Jianpeng Ma <redacted>
---
 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);
Applied,
Thanks,
NeilBrown
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help