diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-10-12 07:29:33 +0200 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-10-21 00:26:06 +0200 |
commit | 79cd22d3ac921b9209bf813c7e75e6b69e74896c (patch) | |
tree | 5db5b2f1cb8620f6ad4a23e56b3743a669696fa2 /fs/ocfs2/cluster/nodemanager.c | |
parent | Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus (diff) | |
download | linux-79cd22d3ac921b9209bf813c7e75e6b69e74896c.tar.xz linux-79cd22d3ac921b9209bf813c7e75e6b69e74896c.zip |
ocfs2: delete redundant memcmp()
This patch deletes redundant memcmp() while looking up in rb tree.
Signed-off-by: Akinbou Mita <akinobu.mita@gmail.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/cluster/nodemanager.c')
-rw-r--r-- | fs/ocfs2/cluster/nodemanager.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index e1fceb8aa32d..d11753c50bc1 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c @@ -152,14 +152,16 @@ static struct o2nm_node *o2nm_node_ip_tree_lookup(struct o2nm_cluster *cluster, struct o2nm_node *node, *ret = NULL; while (*p) { + int cmp; + parent = *p; node = rb_entry(parent, struct o2nm_node, nd_ip_node); - if (memcmp(&ip_needle, &node->nd_ipv4_address, - sizeof(ip_needle)) < 0) + cmp = memcmp(&ip_needle, &node->nd_ipv4_address, + sizeof(ip_needle)); + if (cmp < 0) p = &(*p)->rb_left; - else if (memcmp(&ip_needle, &node->nd_ipv4_address, - sizeof(ip_needle)) > 0) + else if (cmp > 0) p = &(*p)->rb_right; else { ret = node; |