aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/port.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2010-09-03 04:33:39 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-06 21:12:56 -0400
commit5d9c54c1e9ececcf7e99c4f014f9bec7ee3a7def (patch)
treeb901d720e08c5762a0bd52b404393bb8532a6a15 /net/tipc/port.c
parentdcfc5d787a24b9a20be3e18e3dbbab5280d35e38 (diff)
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 <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/port.c')
-rw-r--r--net/tipc/port.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c
index ebcbc21d8f98..d760336f2ca8 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -1464,7 +1464,7 @@ int tipc_forward2name(u32 ref,
1464 msg_set_destnode(msg, destnode); 1464 msg_set_destnode(msg, destnode);
1465 msg_set_destport(msg, destport); 1465 msg_set_destport(msg, destport);
1466 1466
1467 if (likely(destport || destnode)) { 1467 if (likely(destport)) {
1468 p_ptr->sent++; 1468 p_ptr->sent++;
1469 if (likely(destnode == tipc_own_addr)) 1469 if (likely(destnode == tipc_own_addr))
1470 return tipc_port_recv_sections(p_ptr, num_sect, msg_sect); 1470 return tipc_port_recv_sections(p_ptr, num_sect, msg_sect);
@@ -1542,7 +1542,7 @@ int tipc_forward_buf2name(u32 ref,
1542 skb_push(buf, LONG_H_SIZE); 1542 skb_push(buf, LONG_H_SIZE);
1543 skb_copy_to_linear_data(buf, msg, LONG_H_SIZE); 1543 skb_copy_to_linear_data(buf, msg, LONG_H_SIZE);
1544 msg_dbg(buf_msg(buf),"PREP:"); 1544 msg_dbg(buf_msg(buf),"PREP:");
1545 if (likely(destport || destnode)) { 1545 if (likely(destport)) {
1546 p_ptr->sent++; 1546 p_ptr->sent++;
1547 if (destnode == tipc_own_addr) 1547 if (destnode == tipc_own_addr)
1548 return tipc_port_recv_msg(buf); 1548 return tipc_port_recv_msg(buf);