From: Allan Stephens Date: Tue, 17 Aug 2010 11:00:12 +0000 (+0000) Subject: tipc: Optimize tipc_node_has_active_links() X-Git-Tag: firefly_0821_release~7613^2~3670^2~803 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=76ae0d71d839b365faa7fdca0eec85a6d1a20d95;p=firefly-linux-kernel-4.4.55.git tipc: Optimize tipc_node_has_active_links() Eliminate unnecessary checking for null node pointer and redundant check of second active link array entry. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- diff --git a/net/tipc/node.c b/net/tipc/node.c index b634942caba5..940851797615 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -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)