Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Dec 2010 21:57:54 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216859 - head/sys/net
Message-ID:  <201012312157.oBVLvsuP089958@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri Dec 31 21:57:54 2010
New Revision: 216859
URL: http://svn.freebsd.org/changeset/base/216859

Log:
  Use NULL rather than 0 to invalidate a pointer.
  
  Rather than duplicating the LLE_FREE_LOCKED() macro code in LLE_FREE(),
  call it directly (like we do for the RT_* macros).
  
  Sponsored by:	ISPsystem [1]
  Reviewed by:	julian [1]
  MFC After:	1 week
  
  [1] Early 2010.

Modified:
  head/sys/net/if_llatbl.h

Modified: head/sys/net/if_llatbl.h
==============================================================================
--- head/sys/net/if_llatbl.h	Fri Dec 31 21:52:51 2010	(r216858)
+++ head/sys/net/if_llatbl.h	Fri Dec 31 21:57:54 2010	(r216859)
@@ -116,19 +116,12 @@ struct llentry {
 		LLE_WUNLOCK(lle);				\
 	}							\
 	/* guard against invalid refs */			\
-	lle = 0;						\
+	lle = NULL;						\
 } while (0)
 
 #define	LLE_FREE(lle) do {					\
 	LLE_WLOCK(lle);						\
-	if ((lle)->lle_refcnt <= 1)				\
-		(lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\
-	else {							\
-		(lle)->lle_refcnt--;				\
-		LLE_WUNLOCK(lle);				\
-	}							\
-	/* guard against invalid refs */			\
-	lle = NULL;						\
+	LLE_FREE_LOCKED(lle);					\
 } while (0)
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012312157.oBVLvsuP089958>