Skip to content

Commit

Permalink
tipc: Eliminate checks for empty zone list during name translation
Browse files Browse the repository at this point in the history
Gets rid of a pair of checks to see if a name sequence entry in
TIPC's name table has an empty zone list. These checks are pointless
since the zone list can never be empty (i.e. as soon as the list
becomes empty the associated name sequence entry is deleted).

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Jun 24, 2011
1 parent f6f0a4d commit 8af4638
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,13 @@ u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode)
cluster_list);
list_move_tail(&publ->cluster_list,
&info->cluster_list);
} else if (!list_empty(&info->zone_list)) {
} else {
publ = list_first_entry(&info->zone_list,
struct publication,
zone_list);
list_move_tail(&publ->zone_list,
&info->zone_list);
} else
goto no_match;
}
}

/* Round-Robin Algorithm: */
Expand All @@ -598,8 +597,6 @@ u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode)
cluster_list);
list_move_tail(&publ->cluster_list, &info->cluster_list);
} else {
if (list_empty(&info->zone_list))
goto no_match;
publ = list_first_entry(&info->zone_list, struct publication,
zone_list);
list_move_tail(&publ->zone_list, &info->zone_list);
Expand Down

0 comments on commit 8af4638

Please sign in to comment.