Re: [minor fix] radixtree: regulate tag get return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 4 Jun 2006 19:17:54 +0800
Wu Fengguang <[email protected]> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux