diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2011-10-14 14:42:25 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2011-12-27 11:33:46 -0500 |
commit | 945af1c39df00a1e5873e38145432ba752ec49a0 (patch) | |
tree | 4fecb46c23a92b3635eb1db071b4e08edbe9fe86 /net | |
parent | 97f1b625d133b44d38b8b55ec2cbe35d7ef94f3a (diff) |
tipc: Eliminate useless check when network address is assigned
Gets rid of an unnecessary check in the routine that updates the port id
of a node's name publications when the node is assigned a network address,
since the routine is only invoked if the new address is different from
the existing one.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/tipc/name_distr.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index b7ca1bd7b151..be8306f9139e 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c | |||
@@ -322,10 +322,9 @@ void tipc_named_recv(struct sk_buff *buf) | |||
322 | /** | 322 | /** |
323 | * tipc_named_reinit - re-initialize local publication list | 323 | * tipc_named_reinit - re-initialize local publication list |
324 | * | 324 | * |
325 | * This routine is called whenever TIPC networking is (re)enabled. | 325 | * This routine is called whenever TIPC networking is enabled. |
326 | * All existing publications by this node that have "cluster" or "zone" scope | 326 | * All existing publications by this node that have "cluster" or "zone" scope |
327 | * are updated to reflect the node's current network address. | 327 | * are updated to reflect the node's new network address. |
328 | * (If the node's address is unchanged, the update loop terminates immediately.) | ||
329 | */ | 328 | */ |
330 | 329 | ||
331 | void tipc_named_reinit(void) | 330 | void tipc_named_reinit(void) |
@@ -333,10 +332,9 @@ void tipc_named_reinit(void) | |||
333 | struct publication *publ; | 332 | struct publication *publ; |
334 | 333 | ||
335 | write_lock_bh(&tipc_nametbl_lock); | 334 | write_lock_bh(&tipc_nametbl_lock); |
336 | list_for_each_entry(publ, &publ_root, local_list) { | 335 | |
337 | if (publ->node == tipc_own_addr) | 336 | list_for_each_entry(publ, &publ_root, local_list) |
338 | break; | ||
339 | publ->node = tipc_own_addr; | 337 | publ->node = tipc_own_addr; |
340 | } | 338 | |
341 | write_unlock_bh(&tipc_nametbl_lock); | 339 | write_unlock_bh(&tipc_nametbl_lock); |
342 | } | 340 | } |