tipc: Remove redundant search when enabling bearer
authorAllan Stephens <allan.stephens@windriver.com>
Fri, 27 May 2011 18:02:48 +0000 (14:02 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 18 Sep 2011 02:55:06 +0000 (22:55 -0400)
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 <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/eth_media.c

index 69bedd8a297b966c33a2ff989aa504055df79f03..413b33742a991f2fd691a4563937852a675ed18c 100644 (file)
@@ -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 */