[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANN689ET-2q_7WY+4HZjMqQEmLpOQyWOrOzRnP3ADc8TAzoEXw@mail.gmail.com>
Date: Mon, 26 Aug 2013 15:01:49 -0700
From: Michel Lespinasse <walken@...gle.com>
To: zwu.kernel@...il.com
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
Subject: Re: [PATCH] rbtree: Add some necessary condition checks
On Fri, Aug 23, 2013 at 7:45 AM, <zwu.kernel@...il.com> wrote:
> From: Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
>
> Signed-off-by: Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
> ---
> include/linux/rbtree_augmented.h | 3 ++-
> lib/rbtree.c | 5 +++--
> 2 files changed, 5 insertions(+), 3 deletions(-)
So, you are saying that the checks are necessary, but you are not saying why.
The way I see it, the checks are *not* necessary, because the rbtree
invariants guarantee them to be true. The only way for the checks to
fail would be if people directly manipulate the rbtrees without going
through the proper APIs, and if they do that then I think they're on
their own. So to me, I think it's the same situation as dereferencing
a pointer without checking if it's NULL, because you know it should
never be NULL - which in my eyes is perfectly acceptable.
If you really feel this is a problem, you should explain why. I would
also prefer if any checks you add could be limited to debug builds.
--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.
--
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