From: Wu Fengguang <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, nickpiggin@yahoo.com.au
Subject: [minor fix] radixtree: regulate tag get return value
Date: Sun, 4 Jun 2006 16:45:48 +0800 [thread overview]
Message-ID: <349410738.29011@ustc.edu.cn> (raw)
Message-ID: <20060604084548.GA5609@mail.ustc.edu.cn> (raw)
Andrew, this small patch makes the radixtree tester program from
http://www.zip.com.au/~akpm/linux/patches/stuff/rtth.tar.gz
run OK, with the latest radix tree code in linux-2.6.17-rc5-mm2.
It regulates the return value to 0/1 for functions
radix_tree_tag_get() and radix_tree_tagged().
Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---
--- linux.orig/lib/radix-tree.c
+++ linux/lib/radix-tree.c
@@ -156,7 +156,7 @@ static inline void tag_clear(struct radi
static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
int offset)
{
- return test_bit(offset, node->tags[tag]);
+ return !! test_bit(offset, node->tags[tag]);
}
static inline void root_tag_set(struct radix_tree_root *root, unsigned int tag)
@@ -177,7 +177,7 @@ static inline void root_tag_clear_all(st
static inline int root_tag_get(struct radix_tree_root *root, unsigned int tag)
{
- return root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT));
+ return !! (root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT)));
}
/*
next reply other threads:[~2006-06-04 8:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-04 8:45 Wu Fengguang [this message]
2006-06-04 8:45 ` [minor fix] radixtree: regulate tag get return value Wu Fengguang
2006-06-04 9:11 ` Andrew Morton
2006-06-04 11:17 ` Wu Fengguang
2006-06-04 11:17 ` Wu Fengguang
2006-06-04 20:18 ` Andrew Morton
2006-06-04 11:26 ` [PATCH] radixtree: normalize radix_tree_tag_get() " Wu Fengguang
2006-06-04 11:26 ` Wu Fengguang
-- strict thread matches above, loose matches on Subject: below --
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=349410738.29011@ustc.edu.cn \
--to=wfg@mail.ustc.edu.cn \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.