diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2008-06-04 20:47:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-04 20:47:55 -0400 |
commit | 9bef54383d16568da19cfe46bdc52cdedb9bb8da (patch) | |
tree | 52aded38756c475101c7c663fc15dd17880874a1 /net/tipc | |
parent | bd7845337b105e090dd18912d511139945fa7586 (diff) |
tipc: Message header creation optimizations
This patch eliminates several cases where message header fields
were being set to the same value twice.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/port.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c index e3e9c121afbe..93014f9bc95f 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -244,11 +244,8 @@ 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, LONG_H_SIZE, 0); | 247 | msg_init(msg, importance, TIPC_NAMED_MSG, LONG_H_SIZE, 0); |
248 | msg_set_orignode(msg, tipc_own_addr); | ||
249 | msg_set_prevnode(msg, tipc_own_addr); | ||
250 | msg_set_origport(msg, ref); | 248 | msg_set_origport(msg, ref); |
251 | msg_set_importance(msg,importance); | ||
252 | p_ptr->last_in_seqno = 41; | 249 | p_ptr->last_in_seqno = 41; |
253 | p_ptr->sent = 1; | 250 | p_ptr->sent = 1; |
254 | INIT_LIST_HEAD(&p_ptr->wait_list); | 251 | INIT_LIST_HEAD(&p_ptr->wait_list); |
@@ -407,7 +404,6 @@ static struct sk_buff *port_build_proto_msg(u32 destport, u32 destnode, | |||
407 | msg_set_errcode(msg, err); | 404 | msg_set_errcode(msg, err); |
408 | msg_set_destport(msg, destport); | 405 | msg_set_destport(msg, destport); |
409 | msg_set_origport(msg, origport); | 406 | msg_set_origport(msg, origport); |
410 | msg_set_destnode(msg, destnode); | ||
411 | msg_set_orignode(msg, orignode); | 407 | msg_set_orignode(msg, orignode); |
412 | msg_set_transp_seqno(msg, seqno); | 408 | msg_set_transp_seqno(msg, seqno); |
413 | msg_set_msgcnt(msg, ack); | 409 | msg_set_msgcnt(msg, ack); |
@@ -451,7 +447,6 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err) | |||
451 | msg_init(rmsg, imp, msg_type(msg), hdr_sz, msg_orignode(msg)); | 447 | msg_init(rmsg, imp, msg_type(msg), hdr_sz, msg_orignode(msg)); |
452 | msg_set_errcode(rmsg, err); | 448 | msg_set_errcode(rmsg, err); |
453 | msg_set_destport(rmsg, msg_origport(msg)); | 449 | msg_set_destport(rmsg, msg_origport(msg)); |
454 | msg_set_prevnode(rmsg, tipc_own_addr); | ||
455 | msg_set_origport(rmsg, msg_destport(msg)); | 450 | msg_set_origport(rmsg, msg_destport(msg)); |
456 | if (msg_short(msg)) | 451 | if (msg_short(msg)) |
457 | msg_set_orignode(rmsg, tipc_own_addr); | 452 | msg_set_orignode(rmsg, tipc_own_addr); |