[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A53FE21.40009@kernel.org>
Date: Wed, 08 Jul 2009 11:02:09 +0900
From: Tejun Heo <tj@...nel.org>
To: "Figo.zhang" <figo1802@...il.com>
CC: Andrew Morton <akpm@...l.org>, lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vmalloc.c: fix double error checking
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists