From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 21:57:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFCFF1065679; Fri, 31 Dec 2010 21:57:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B00118FC14; Fri, 31 Dec 2010 21:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVLvsFM089960; Fri, 31 Dec 2010 21:57:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVLvsuP089958; Fri, 31 Dec 2010 21:57:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012312157.oBVLvsuP089958@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 21:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216859 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 21:57:54 -0000 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)