Author: bz
Date: Fri Jan 10 23:52:36 2020
New Revision: 356620
URL: https://svnweb.freebsd.org/changeset/base/356620

Log:
  MFC r354726,354755:
  
    if_llatbl: cleanup
    if_llatbl: change htable_unlink_entry() to early exist if no work to do
  
    No functional change.

Modified:
  stable/12/sys/net/if_llatbl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if_llatbl.c
==============================================================================
--- stable/12/sys/net/if_llatbl.c       Fri Jan 10 23:46:12 2020        
(r356619)
+++ stable/12/sys/net/if_llatbl.c       Fri Jan 10 23:52:36 2020        
(r356620)
@@ -79,11 +79,6 @@ RW_SYSINIT(lltable_list_lock, &lltable_list_lock, "llt
 static void lltable_unlink(struct lltable *llt);
 static void llentries_unlink(struct lltable *llt, struct llentries *head);
 
-static void htable_unlink_entry(struct llentry *lle);
-static void htable_link_entry(struct lltable *llt, struct llentry *lle);
-static int htable_foreach_lle(struct lltable *llt, llt_foreach_cb_t *f,
-    void *farg);
-
 /*
  * Dump lle state for a specific address family.
  */
@@ -180,15 +175,16 @@ static void
 htable_unlink_entry(struct llentry *lle)
 {
 
-       if ((lle->la_flags & LLE_LINKED) != 0) {
-               IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp);
-               CK_LIST_REMOVE(lle, lle_next);
-               lle->la_flags &= ~(LLE_VALID | LLE_LINKED);
+       if ((lle->la_flags & LLE_LINKED) == 0)
+               return;
+
+       IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp);
+       CK_LIST_REMOVE(lle, lle_next);
+       lle->la_flags &= ~(LLE_VALID | LLE_LINKED);
 #if 0
-               lle->lle_tbl = NULL;
-               lle->lle_head = NULL;
+       lle->lle_tbl = NULL;
+       lle->lle_head = NULL;
 #endif
-       }
 }
 
 struct prefix_match_data {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to