From owner-svn-src-all@FreeBSD.ORG Tue Jan 11 00:29:17 2011 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 A6DA01065674; Tue, 11 Jan 2011 00:29:17 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965E48FC17; Tue, 11 Jan 2011 00:29:17 +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 p0B0THoZ000384; Tue, 11 Jan 2011 00:29:17 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0B0THRK000382; Tue, 11 Jan 2011 00:29:17 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101110029.p0B0THRK000382@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 11 Jan 2011 00:29:17 +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: r217248 - head/sys/kern 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: Tue, 11 Jan 2011 00:29:17 -0000 Author: lstewart Date: Tue Jan 11 00:29:17 2011 New Revision: 217248 URL: http://svn.freebsd.org/changeset/base/217248 Log: Fix some minor style/readability nits in hhook. Sponsored by: FreeBSD Foundation Submitted by: pjd MFC after: 9 weeks X-MFC with: r216615 Modified: head/sys/kern/kern_hhook.c Modified: head/sys/kern/kern_hhook.c ============================================================================== --- head/sys/kern/kern_hhook.c Mon Jan 10 23:47:11 2011 (r217247) +++ head/sys/kern/kern_hhook.c Tue Jan 11 00:29:17 2011 (r217248) @@ -156,8 +156,7 @@ hhook_add_hook(struct hhook_head *hhh, s if (!error) { STAILQ_INSERT_TAIL(&hhh->hhh_hooks, hhk, hhk_next); hhh->hhh_nhooks++; - } - else + } else free(hhk, M_HHOOK); HHH_WUNLOCK(hhh); @@ -332,7 +331,6 @@ hhook_head_deregister_lookup(int32_t hho struct hhook_head *hhh; int error; - error = 0; hhh = hhook_head_get(hhook_type, hhook_id); error = hhook_head_deregister(hhh); @@ -356,13 +354,12 @@ hhook_head_get(int32_t hhook_type, int32 LIST_FOREACH(hhh, &V_hhook_head_list, hhh_next) { if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) { refcount_acquire(&hhh->hhh_refcount); - HHHLIST_UNLOCK(); - return (hhh); + break; } } HHHLIST_UNLOCK(); - return (NULL); + return (hhh); } void