From owner-svn-src-projects@FreeBSD.ORG Wed Sep 30 10:59:09 2009 Return-Path: <owner-svn-src-projects@FreeBSD.ORG> Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3511B1065693; Wed, 30 Sep 2009 10:59:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id C6CAE8FC2D; Wed, 30 Sep 2009 10:59:08 +0000 (UTC) Received: from besplex.bde.org (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n8UAx5TE011749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Sep 2009 20:59:06 +1000 Date: Wed, 30 Sep 2009 20:59:05 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> X-X-Sender: bde@besplex.bde.org To: Lawrence Stewart <lstewart@freebsd.org> In-Reply-To: <200909300953.n8U9r3Oo011112@svn.freebsd.org> Message-ID: <20090930203736.D1368@besplex.bde.org> References: <200909300953.n8U9r3Oo011112@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197638 - projects/tcp_ffcaia2008_8.x/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" <svn-src-projects.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects> List-Post: <mailto:svn-src-projects@freebsd.org> List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, <mailto:svn-src-projects-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 30 Sep 2009 10:59:09 -0000 On Wed, 30 Sep 2009, Lawrence Stewart wrote: > Log: > Alphabetically order includes. > ... > Modified: projects/tcp_ffcaia2008_8.x/sys/kern/kern_alq.c > ============================================================================== > --- projects/tcp_ffcaia2008_8.x/sys/kern/kern_alq.c Wed Sep 30 08:48:59 2009 (r197637) > +++ projects/tcp_ffcaia2008_8.x/sys/kern/kern_alq.c Wed Sep 30 09:53:03 2009 (r197638) > @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); > #include "opt_mac.h" > > #include <sys/param.h> > -#include <sys/systm.h> > +#include <sys/alq.h> > +#include <sys/eventhandler.h> > +#include <sys/fcntl.h> > #include <sys/kernel.h> > #include <sys/kthread.h> > #include <sys/lock.h> > @@ -44,12 +46,9 @@ __FBSDID("$FreeBSD$"); > #include <sys/mutex.h> > #include <sys/namei.h> > #include <sys/proc.h> > -#include <sys/vnode.h> > -#include <sys/alq.h> > -#include <sys/malloc.h> > +#include <sys/systm.h> > ... <sys/systm.h> should not be sorted alphabeticaly, since it declares things like KASSERT() and (by nested includes) hundreds of inline functions (especially ones in <machine/atomic.h>, <machine/cpufunc.h> and <sys/libkern.h>) which are used in many other headers. It should be sorted immediately after <sys/param.h> where it was. Mis-sorting it is sometimes masked by namespace pollution in other headers. <sys/mbuf.h> has the grossest namespace pollution despite me once completely cleaning it up :-(. It now includes <sys/systm.h> and <vm/uma.h>. (<vm/uma.h> is even more disgusting. It starts by including <sys/param.h> and says that this is "/* for NULL */", despite there being a whole header <sys/_null.h> for the purpose of defining NULL and thus avoiding namespace which would be caused by defining NULL in a more central header, and despite it using _much_ more of <sys/param.h> than the definition of NULL.) But most headers aren't as bad. Thus sorting <sys/systm.h> alphabetically (near the end) rarely works, and even when it works it is fragile and will break when a header sorted before it starts using KASSERT(). Bruce