Skip to content

Commit

Permalink
tipc: Remove redundant search when enabling bearer
Browse files Browse the repository at this point in the history
Removes obsolete code that searches for an Ethernet bearer structure entry
to use for a newly enabled bearer, since this search is now performed
at the start of the enabling algorithm.

Signed-off-by: Allan Stephens <[email protected]>
Signed-off-by: Paul Gortmaker <[email protected]>
  • Loading branch information
ajstephens authored and Paul Gortmaker committed Sep 18, 2011
1 parent bcd326e commit 18abf0f
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions net/tipc/eth_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,15 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
if (!dev)
return -ENODEV;

/* Find Ethernet bearer for device (or create one) */

while ((eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev))
eb_ptr++;
if (eb_ptr == stop)
return -EDQUOT;
if (!eb_ptr->dev) {
eb_ptr->dev = dev;
eb_ptr->tipc_packet_type.type = htons(ETH_P_TIPC);
eb_ptr->tipc_packet_type.dev = dev;
eb_ptr->tipc_packet_type.func = recv_msg;
eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list));
dev_add_pack(&eb_ptr->tipc_packet_type);
}
/* Create Ethernet bearer for device */

eb_ptr->dev = dev;
eb_ptr->tipc_packet_type.type = htons(ETH_P_TIPC);
eb_ptr->tipc_packet_type.dev = dev;
eb_ptr->tipc_packet_type.func = recv_msg;
eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list));
dev_add_pack(&eb_ptr->tipc_packet_type);

/* Associate TIPC bearer with Ethernet bearer */

Expand Down

0 comments on commit 18abf0f

Please sign in to comment.