Re: git: 68912701700c - main - ffs_suspend.c: clean up includes

From: Mike Karels <mike_at_karels.net>
Date: Thu, 29 Dec 2022 21:19:39 UTC
On 29 Dec 2022, at 14:56, Konstantin Belousov wrote:

> The branch main has been updated by kib:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=68912701700ca3230f3e2d4b7858a038f884a327
>
> commit 68912701700ca3230f3e2d4b7858a038f884a327
> Author:     Konstantin Belousov <kib@FreeBSD.org>
> AuthorDate: 2022-12-28 18:17:53 +0000
> Commit:     Konstantin Belousov <kib@FreeBSD.org>
> CommitDate: 2022-12-29 20:55:39 +0000
>
>     ffs_suspend.c: clean up includes
>
>     Order includes alphabetically.
>     Remove unneeded sys/param.h, it is already included by sys/systm.h.

I am surprised by the last change; it seems contrary to the spirit (at
least) of style(9).  In particular, style(9) says that param.h or types.h
goes first (or after cdefs.h), followed by systm.h if needed.  I don’t
object to direct inclusion of param.h even if one of the 14 other headers
in sys/ that include param.h are also included.

		Mike

>     Reviewed by:    mckusick
>     Sponsored by:   The FreeBSD Foundation
>     MFC after:      1 week
>     Differential revision:  https://reviews.freebsd.org/D37896
> ---
>  sys/ufs/ffs/ffs_suspend.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c
> index d13097109758..e7c976b6e921 100644
> --- a/sys/ufs/ffs/ffs_suspend.c
> +++ b/sys/ufs/ffs/ffs_suspend.c
> @@ -33,15 +33,14 @@
>  #include <sys/cdefs.h>
>  __FBSDID("$FreeBSD$");
>
> -#include <sys/param.h>
>  #include <sys/systm.h>
>  #include <sys/buf.h>
> -#include <sys/ioccom.h>
> -#include <sys/mount.h>
> -#include <sys/vnode.h>
>  #include <sys/conf.h>
> +#include <sys/ioccom.h>
>  #include <sys/jail.h>
> +#include <sys/mount.h>
>  #include <sys/sx.h>
> +#include <sys/vnode.h>
>
>  #include <security/mac/mac_framework.h>