summaryrefslogtreecommitdiffstats
path: root/sys/net/if_llatbl.h
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-12-31 21:57:54 +0000
committerbz <bz@FreeBSD.org>2010-12-31 21:57:54 +0000
commit43c37d3ddd36bdfbdd60c529a228f1c741694657 (patch)
tree113ed806ca0663835afbded2dcdf405c6d50247a /sys/net/if_llatbl.h
parentf044c11165cde8629ccc5c12de7bcf3fdeded5c8 (diff)
downloadFreeBSD-src-43c37d3ddd36bdfbdd60c529a228f1c741694657.zip
FreeBSD-src-43c37d3ddd36bdfbdd60c529a228f1c741694657.tar.gz
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.
Diffstat (limited to 'sys/net/if_llatbl.h')
-rw-r--r--sys/net/if_llatbl.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h
index 6c5ad18..babe743 100644
--- a/sys/net/if_llatbl.h
+++ b/sys/net/if_llatbl.h
@@ -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)
OpenPOWER on IntegriCloud