From: Tejun Heo <tj@kernel.org>
To: "Figo.zhang" <figo1802@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vmalloc.c: fix double error checking
Date: Wed, 08 Jul 2009 11:02:09 +0900 [thread overview]
Message-ID: <4A53FE21.40009@kernel.org> (raw)
In-Reply-To: <1247013611.2597.22.camel@myhost>
Figo.zhang wrote:
> On Wed, 2009-07-08 at 09:19 +0900, Tejun Heo wrote:
>> Figo.zhang wrote:
>>> it is no need for double error checking.
>>>
>>> Signed-off-by: Figo.zhang <figo1802@gmail.com>
>>> - 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;
>> Wouldn't it be better to keep the error return value?
>
> see the vmap_pud_range(), if suceed return 0, if error return "-ENOMEM",
> so it had better use clearly logic if error directly return "-EOMEM",
> avoid double checking.
Yeah, I saw that but I still think it would be (minutely) better to
just pass through the error value. It isn't exclusive with double
error checking, just do err = vmap_pud_range(); if (err) return err;
Thanks.
--
tejun
next prev parent reply other threads:[~2009-07-08 2:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 16:13 [PATCH] vmalloc.c: fix double error checking Figo.zhang
2009-07-08 0:19 ` Tejun Heo
2009-07-08 0:40 ` Figo.zhang
2009-07-08 2:02 ` Tejun Heo [this message]
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=4A53FE21.40009@kernel.org \
--to=tj@kernel.org \
--cc=akpm@osdl.org \
--cc=figo1802@gmail.com \
--cc=linux-kernel@vger.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