Skip to content

Commit

Permalink
tipc: Optimize tipc_node_has_active_links()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Aug 18, 2010
1 parent 96d841b commit 76ae0d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/tipc/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76ae0d7

Please sign in to comment.