tipc: Optimize tipc_node_has_active_links()
authorAllan Stephens <allan.stephens@windriver.com>
Tue, 17 Aug 2010 11:00:12 +0000 (11:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Aug 2010 00:31:57 +0000 (17:31 -0700)
Eliminate unnecessary checking for null node pointer and redundant
check of second active link array entry.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node.c

index b634942caba5d5ed9204269c327b9fa6fef4512f..9408517976158b4a1c3e2b29c46a6b9727efcdc8 100644 (file)
@@ -237,8 +237,7 @@ void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr)
 
 int tipc_node_has_active_links(struct tipc_node *n_ptr)
 {
-       return (n_ptr &&
-               ((n_ptr->active_links[0]) || (n_ptr->active_links[1])));
+       return n_ptr->active_links[0] != NULL;
 }
 
 int tipc_node_has_redundant_links(struct tipc_node *n_ptr)