From owner-freebsd-net@FreeBSD.ORG Thu Oct 4 23:22:01 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B943106566C for ; Thu, 4 Oct 2012 23:22:01 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id B9AF38FC08 for ; Thu, 4 Oct 2012 23:22:00 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id c50so962649eek.13 for ; Thu, 04 Oct 2012 16:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vKyVyFYZCMiNmoqZ8di6UVgxWBTD2xSieM/lqW86+1c=; b=diWjUHI6cPBDWMK64+98jGhtV4pAtmcQORNzkaTZcBlsc3T0ZS9va5J9XmW17GC2sp e/vsW080zJu1X8fyPQAxxzGICnSTThJS7vO1os0LHjFawEWd5I+QNLwboi4/6naCGwwv Tfj7z9mqLNUVABAMrxD82wVyivALFnMXFmIXXqtBVC1pceUu74RamUMFK7I3x6Wmzi/0 ta226nFtQpoCz3F1P0GwQ6vzCQtk7zzsa3MhHjPzNQfNHepsEnBrv3XqyL4KuhvxidYs 14EkDzc86WRgFUr0GzjdwZ+JAUzPDquRTIPDrXnENUO+ji6b00AsL3KWM5iagxNzHQPI QYtA== MIME-Version: 1.0 Received: by 10.14.205.9 with SMTP id i9mr10730766eeo.21.1349392919343; Thu, 04 Oct 2012 16:21:59 -0700 (PDT) Received: by 10.14.199.73 with HTTP; Thu, 4 Oct 2012 16:21:59 -0700 (PDT) Date: Thu, 4 Oct 2012 16:21:59 -0700 Message-ID: From: Vijay Singh To: net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: A small cleanup patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2012 23:22:01 -0000 Folks, I came up with this while going through the lltable code. kong@[/u/vijay/bsd/CODE/cur/sys]# svn diff net/if.c Index: net/if.c =================================================================== --- net/if.c (revision 241169) +++ net/if.c (working copy) @@ -691,12 +691,9 @@ if_attachdomain(void *dummy) { struct ifnet *ifp; - int s; - s = splnet(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) if_attachdomain1(ifp); - splx(s); } SYSINIT(domainifattach, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_SECOND, if_attachdomain, NULL); @@ -705,22 +702,17 @@ if_attachdomain1(struct ifnet *ifp) { struct domain *dp; - int s; - s = splnet(); - /* * Since dp->dom_ifattach calls malloc() with M_WAITOK, we * cannot lock ifp->if_afdata initialization, entirely. */ if (IF_AFDATA_TRYLOCK(ifp) == 0) { - splx(s); return; } if (ifp->if_afdata_initialized >= domain_init_status) { IF_AFDATA_UNLOCK(ifp); - splx(s); - printf("if_attachdomain called more than once on %s\n", + log(LOG_WARNING, "if_attachdomain called more than once on %s\n", ifp->if_xname); return; } @@ -734,8 +726,6 @@ ifp->if_afdata[dp->dom_family] = (*dp->dom_ifattach)(ifp); } - - splx(s); } /*