From: "Figo.zhang" <figo1802@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Tejun Heo <tj@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] vmalloc.c: fix double error checking
Date: Wed, 08 Jul 2009 00:13:21 +0800 [thread overview]
Message-ID: <1246983201.2597.13.camel@myhost> (raw)
it is no need for double error checking.
Signed-off-by: Figo.zhang <figo1802@gmail.com>
---
mm/vmalloc.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f8189a4..56b2469 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -159,20 +159,15 @@ static int vmap_page_range_noflush(unsigned long start, unsigned long end,
pgd_t *pgd;
unsigned long next;
unsigned long addr = start;
- int err = 0;
int nr = 0;
BUG_ON(addr >= end);
pgd = pgd_offset_k(addr);
do {
next = pgd_addr_end(addr, end);
- err = vmap_pud_range(pgd, addr, next, prot, pages, &nr);
- if (err)
- break;
+ if (vmap_pud_range(pgd, addr, next, prot, pages, &nr))
+ return -ENOMEM;
} while (pgd++, addr = next, addr != end);
-
- if (unlikely(err))
- return err;
return nr;
}
next reply other threads:[~2009-07-07 16:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 16:13 Figo.zhang [this message]
2009-07-08 0:19 ` [PATCH] vmalloc.c: fix double error checking Tejun Heo
2009-07-08 0:40 ` Figo.zhang
2009-07-08 2:02 ` Tejun Heo
2009-07-08 2:11 ` [PATCH v2] " Figo.zhang
2009-07-08 2:16 ` Tejun Heo
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=1246983201.2597.13.camel@myhost \
--to=figo1802@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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