Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Aug 2019 20:47:44 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        "Bjoern A. Zeeb" <bz@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r350532 - head/sys/netinet6
Message-ID:  <20190802203707.S1343@besplex.bde.org>
In-Reply-To: <201908021006.x72A6smN041745@repo.freebsd.org>
References:  <201908021006.x72A6smN041745@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2 Aug 2019, Bjoern A. Zeeb wrote:

> Log:
>  frag6.c: sort includes
>
>  Sort includes and remove duplicate kernel.h as well as the unneeded
>  systm.h.

sys/systm.h is always needed, since it defines macros and functions which
might be needed in other headers.  frag6.c even uses KASSERT() directly.

> Modified: head/sys/netinet6/frag6.c
> ==============================================================================
> --- head/sys/netinet6/frag6.c	Fri Aug  2 07:41:36 2019	(r350531)
> +++ head/sys/netinet6/frag6.c	Fri Aug  2 10:06:54 2019	(r350532)
> @@ -37,18 +37,16 @@ __FBSDID("$FreeBSD$");
> #include "opt_rss.h"
>
> #include <sys/param.h>
> -#include <sys/systm.h>

This was correct.  sys/systm.h must also be included in this order.

Now the KASSERT() used in frag6.c is apparently obtained via pollution
in some other header.

> -#include <sys/hash.h>
> -#include <sys/malloc.h>
> -#include <sys/mbuf.h>
> #include <sys/domain.h>
> +#include <sys/errno.h>

sys/errno is standard pollution in sys/param.h (if _KERNEL).  It is a style
bug to not depend on this.

> #include <sys/eventhandler.h>
> +#include <sys/hash.h>
> #include <sys/kernel.h>
> +#include <sys/malloc.h>

sys/malloc.h is polluted by including sys/systm.h.

> +#include <sys/mbuf.h>

sys/mbuf.h is polluted by including sys/systm.h.

> #include <sys/protosw.h>
> #include <sys/socket.h>
> -#include <sys/errno.h>
> #include <sys/time.h>

sys/time.h is standard pollution in sys/param.h (if _KERNEL).  It is a style
bug to not depend on this.

> -#include <sys/kernel.h>
> #include <sys/syslog.h>
>
> #include <machine/atomic.h>

machine/atomic.h is standard non-pollution on sys/systm.h.  It is a style
bug to include it directly.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190802203707.S1343>