Patchwork [net-next,10/14] tipc: Optimize tipc_node_has_active_links()

login
register
mail settings
Submitter Paul Gortmaker
Date Aug. 17, 2010, 9 p.m.
Message ID <1282078816-11844-11-git-send-email-paul.gortmaker@windriver.com>
Download mbox | patch
Permalink /patch/61966/
State Accepted
Delegated to: David Miller
Headers show

Comments

Paul Gortmaker - Aug. 17, 2010, 9 p.m.
From: Allan Stephens <allan.stephens@windriver.com>

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>
---
 net/tipc/node.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/net/tipc/node.c b/net/tipc/node.c
index b634942..9408517 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)