aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/port.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2008-06-04 20:37:34 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-04 20:37:34 -0400
commit757152175666681d54d370500e41a756cfedd4fc (patch)
tree39452e5ea148ec0743300a14a336c861a344fe0a /net/tipc/port.c
parent9c396a7bfb4fe74e444be09069651280da520944 (diff)
tipc: Optimize message initialization routine
This patch eliminates the rarely-used "error code" argument when initializing a TIPC message header, since the default value of zero is the desired result in most cases; the few exceptional cases now set the error code explicitly. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/port.c')
-rw-r--r--net/tipc/port.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 4dfef9e798e3..e3e9c121afbe 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -244,8 +244,7 @@ u32 tipc_createport_raw(void *usr_handle,
244 p_ptr->publ.max_pkt = MAX_PKT_DEFAULT; 244 p_ptr->publ.max_pkt = MAX_PKT_DEFAULT;
245 p_ptr->publ.ref = ref; 245 p_ptr->publ.ref = ref;
246 msg = &p_ptr->publ.phdr; 246 msg = &p_ptr->publ.phdr;
247 msg_init(msg, TIPC_LOW_IMPORTANCE, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, 247 msg_init(msg, TIPC_LOW_IMPORTANCE, TIPC_NAMED_MSG, LONG_H_SIZE, 0);
248 0);
249 msg_set_orignode(msg, tipc_own_addr); 248 msg_set_orignode(msg, tipc_own_addr);
250 msg_set_prevnode(msg, tipc_own_addr); 249 msg_set_prevnode(msg, tipc_own_addr);
251 msg_set_origport(msg, ref); 250 msg_set_origport(msg, ref);
@@ -404,7 +403,8 @@ static struct sk_buff *port_build_proto_msg(u32 destport, u32 destnode,
404 buf = buf_acquire(LONG_H_SIZE); 403 buf = buf_acquire(LONG_H_SIZE);
405 if (buf) { 404 if (buf) {
406 msg = buf_msg(buf); 405 msg = buf_msg(buf);
407 msg_init(msg, usr, type, err, LONG_H_SIZE, destnode); 406 msg_init(msg, usr, type, LONG_H_SIZE, destnode);
407 msg_set_errcode(msg, err);
408 msg_set_destport(msg, destport); 408 msg_set_destport(msg, destport);
409 msg_set_origport(msg, origport); 409 msg_set_origport(msg, origport);
410 msg_set_destnode(msg, destnode); 410 msg_set_destnode(msg, destnode);
@@ -448,7 +448,8 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
448 return data_sz; 448 return data_sz;
449 } 449 }
450 rmsg = buf_msg(rbuf); 450 rmsg = buf_msg(rbuf);
451 msg_init(rmsg, imp, msg_type(msg), err, hdr_sz, msg_orignode(msg)); 451 msg_init(rmsg, imp, msg_type(msg), hdr_sz, msg_orignode(msg));
452 msg_set_errcode(rmsg, err);
452 msg_set_destport(rmsg, msg_origport(msg)); 453 msg_set_destport(rmsg, msg_origport(msg));
453 msg_set_prevnode(rmsg, tipc_own_addr); 454 msg_set_prevnode(rmsg, tipc_own_addr);
454 msg_set_origport(rmsg, msg_destport(msg)); 455 msg_set_origport(rmsg, msg_destport(msg));