From: Andrew Morton <akpm@osdl.org>
To: Wu Fengguang <wfg@mail.ustc.edu.cn>
Cc: linux-kernel@vger.kernel.org, nickpiggin@yahoo.com.au
Subject: Re: [minor fix] radixtree: regulate tag get return value
Date: Sun, 4 Jun 2006 13:18:24 -0700 [thread overview]
Message-ID: <20060604131824.e2d1c934.akpm@osdl.org> (raw)
In-Reply-To: <349419864.11444@ustc.edu.cn>
On Sun, 4 Jun 2006 19:17:54 +0800
Wu Fengguang <wfg@mail.ustc.edu.cn> wrote:
> > test_bit() is (sadly) defined to return 0 or 1. Did this really make a difference?
>
> Interesting. I got the following gdb outputs. Note that tag_get()
> returns -1 and root_tag_get() returns 1048576.
>
> (gdb) n
> 399 while (height > 0) {
> (gdb) n
> 402 offset = (index >> shift) & RADIX_TREE_MAP_MASK;
> (gdb)
> 403 if (!tag_get(slot, tag, offset))
> (gdb)
> 404 tag_set(slot, tag, offset);
> (gdb) p tag_get(slot, tag, offset)
> $14 = 0
> (gdb) n
> 405 slot = slot->slots[offset];
> (gdb) p tag_get(slot, tag, offset)
> $15 = -1
You trust gdb more than I do ;) It's doing a pretty tricky thing there.
test_bit() returns (1 & (expr)) - it _has_ to return 0 or 1.
next prev parent reply other threads:[~2006-06-04 20:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060604084548.GA5609@mail.ustc.edu.cn>
2006-06-04 8:45 ` Wu Fengguang
2006-06-04 9:11 ` Andrew Morton
[not found] ` <20060604111754.GA5984@mail.ustc.edu.cn>
2006-06-04 11:17 ` Wu Fengguang
2006-06-04 20:18 ` Andrew Morton [this message]
[not found] ` <20060604112636.GB5984@mail.ustc.edu.cn>
2006-06-04 11:26 ` [PATCH] radixtree: normalize radix_tree_tag_get() " Wu Fengguang
2006-06-05 3:07 [minor fix] radixtree: regulate tag get " Chuck Ebbert
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=20060604131824.e2d1c934.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=wfg@mail.ustc.edu.cn \
/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
Powered by JetHome