linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().
@ 2012-09-15  2:43 Jianpeng Ma
  2012-09-20  2:54 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Jianpeng Ma @ 2012-09-15  2:43 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().
  2012-09-15  2:43 [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page() Jianpeng Ma
@ 2012-09-20  2:54 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-09-20  2:54 UTC (permalink / raw)
  To: Jianpeng Ma; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

On Sat, 15 Sep 2012 10:43:00 +0800 "Jianpeng Ma" <majianpeng@gmail.com> wrote:

> 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);

Applied,
Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-20  2:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15  2:43 [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page() Jianpeng Ma
2012-09-20  2:54 ` NeilBrown

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).