From 5d9c54c1e9ececcf7e99c4f014f9bec7ee3a7def Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 3 Sep 2010 08:33:39 +0000 Subject: tipc: Minor optimizations to name table translation code Optimizes TIPC's name table translation code to avoid unnecessary manipulation of the node address field of the resulting port id when name translation fails. This change is possible because a valid port id cannot have a reference field of zero, so examining the reference only is sufficient to determine if the translation was successful. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/tipc/port.c') diff --git a/net/tipc/port.c b/net/tipc/port.c index ebcbc21d8f9..d760336f2ca 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c @@ -1464,7 +1464,7 @@ int tipc_forward2name(u32 ref, msg_set_destnode(msg, destnode); msg_set_destport(msg, destport); - if (likely(destport || destnode)) { + if (likely(destport)) { p_ptr->sent++; if (likely(destnode == tipc_own_addr)) return tipc_port_recv_sections(p_ptr, num_sect, msg_sect); @@ -1542,7 +1542,7 @@ int tipc_forward_buf2name(u32 ref, skb_push(buf, LONG_H_SIZE); skb_copy_to_linear_data(buf, msg, LONG_H_SIZE); msg_dbg(buf_msg(buf),"PREP:"); - if (likely(destport || destnode)) { + if (likely(destport)) { p_ptr->sent++; if (destnode == tipc_own_addr) return tipc_port_recv_msg(buf); -- cgit v1.2.3-70-g09d2