Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76ae0d71 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller
Browse files

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: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96d841b7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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)