From nobody Wed Nov 26 14:45:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dGj6n3kPDz6J9DW for ; Wed, 26 Nov 2025 14:46:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dGj6m6Ymkz3JtN for ; Wed, 26 Nov 2025 14:46:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-29568d93e87so65213535ad.2 for ; Wed, 26 Nov 2025 06:46:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1764168363; x=1764773163; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AzRjO5BGfW/rintfbXZndjaE6J3+AtVLsujNjNjzRrQ=; b=xz0XqWZ4jUjulawk/inksGVAMnWR4rGOBieCr4kKH13nqluu2V3uDCiBnZq2UGG0WT 284Ii67OmQ20bMOwYOHufAKBIKvNH/GZxDjNxadNqb7g9ITsN5xRIWyw6lkGTw/6ireP guaS6zYQoHLfc034lg8RAOOFNSHwXkhCUrsTw04BmvW1/Gx0XvrBeWAbHiPP/BxrtGvi aPPRIEHCQsymvT+DSHk777qyW1/M+IpNKwn+n7l95iVs2tHSbgliEhVUmtSVv/jsVSMS 2rxC33xzME2V+EOuOVW7DBVAX0sC1+K7efWu0L0TgFpmJZFJfrqCyiBcSX2rQucsJcdQ PRPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764168363; x=1764773163; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AzRjO5BGfW/rintfbXZndjaE6J3+AtVLsujNjNjzRrQ=; b=WmQNkf/DgF9eVPya8fw8/FKJzgnp3ypkI/MCAAowXc1dGmttJ3wDnR6bJoiYucBEzK B1ZuxkIxg+tWS3B/R4V8TREmDprRSX6L/KGo33tf1CkTv5seG0G9BywP2lyzYSFites4 BtOhhGoCJUBwSA/n4AV3THxgOXkDlRgaD4JlyO1oZUpWh5cETlvTumoibcHgPBkLjLLu lHqQXAHn0w9zBPfiHPCdN8WAJDwVXf5UM+tIRZorpvV77E2z83/ee6WfDItPZUKairCR t46clkqv/+6G20QnivarPVu7A1hoPmwKiG7gTMm4c6PeZCPrzta95kTZn4NYMuvrkcfF WJ7A== X-Forwarded-Encrypted: i=1; AJvYcCWh8G5raJ6Hb1C0wqguF6jNncs9u2Ie8dIzr/PNQ1/ZoQ5tFWlG69uVyL8/+Cutk/gYap3MB7dHNF9UDlarrR9t7Sd8SA==@freebsd.org X-Gm-Message-State: AOJu0YyoNEaPg1bYdVdFQ96HPQDx0Ioyy0Fej6bHWKBu02GC+SX3mtad o1QWvRvqgYHqJvZlo9jbPalfwvvfqVK10dk8RJkBl21MJQ7XUlWXTOcakIrdItuncYUy2HNnmyE m3ZqdHl/6t5g++CQ+MfRM8fqd2cGjXe+YUT1IIrT96Q== X-Gm-Gg: ASbGncuwkzKV2Cr8T7g6/t01QgQH/QyUPN/4TcxAMoUuvV7FVMgmC7DAmxMg0UDvGdp xMKZq0phteSapKqWglf/iwXASM6LzZ/E3EEwzIm9fXFssgg0PL3M2QssKlDpKY+pdIZodM1hCbf H2DfpUEOebsyCTkZMGzDvGA12U9kuO0w6GH3c3qAZVdyS2TTvawD6OD5g6s7QBYx29RphEIF+1I K2oSualEapg94J5GTruObKDfuvimaidM9hdlq3rVEG4i0BJO/0I5hnRYqu9QxdyHPoiXcM= X-Google-Smtp-Source: AGHT+IEPDQvdK8EfzHqiyE3JbR7QlYguD+eGXYLCIlONnXv2gLAFeIO+aTdwG+tCzpFzmuX8xS/tmnqJS++4OK3bJ6k= X-Received: by 2002:a17:90b:4c45:b0:341:3ea2:b625 with SMTP id 98e67ed59e1d1-3475ebfa712mr7225881a91.12.1764168362562; Wed, 26 Nov 2025 06:46:02 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <6925d6af.3b42c.336a0065@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 26 Nov 2025 07:45:51 -0700 X-Gm-Features: AWmQ_bktBBg2t8ywe5zhjzVVWMqwQ3d8gEH854O7zn6LSD0gSVyS4dvNWFTURn8 Message-ID: Subject: Re: git: 301b8a806f79 - main - nvme: Minor style(9) fixes To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000932612064480742d" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dGj6m6Ymkz3JtN --000000000000932612064480742d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 26, 2025 at 5:06=E2=80=AFAM Konstantin Belousov wrote: > On Tue, Nov 25, 2025 at 04:17:51PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D301b8a806f79292ee3324ca938a4d93= 8df1911e8 > > > > commit 301b8a806f79292ee3324ca938a4d938df1911e8 > > Author: Warner Losh > > AuthorDate: 2025-11-25 16:10:23 +0000 > > Commit: Warner Losh > > CommitDate: 2025-11-25 16:12:51 +0000 > > > > nvme: Minor style(9) fixes > > > > needs to be first after . And we don't > need > > both sys/param.h and sys/types.h. > > We do not both sys/param.h and sys/systm.h as well, since sys/systm.h > includes sys/param.h. > Style(9): Kernel include files (sys/*.h) come first. If either or is needed, include it before other include files. ( includes ; do not include both.) Next, include , if needed. The remaining kernel headers should be sorted alphabetically. Should I update it to say just include systm.h over param.h over types.h? Or is there some other rule to follow that we should document? A quick survey suggests this is often the case, but a large minority of the time both or even all three are included. However, in this case, I needed to keep it separate because nvme.h is included by userland and I thought systm.h was kernel only (without checking)... but systm.h does seem to have all the proper guards to make that ok... Warner --000000000000932612064480742d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Nov 26,= 2025 at 5:06=E2=80=AFAM Konstantin Belousov <kostikbel@gmail.com> wrote:
On Tue, Nov 25, 2025 at 04:17:51PM +0000, = Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D301b8a806f79292ee3324ca938a4d938df1911e8<= /a>
>
> commit 301b8a806f79292ee3324ca938a4d938df1911e8
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2025-11-25 16:10:23 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2025-11-25 16:12:51 +0000
>
>=C2=A0 =C2=A0 =C2=A0nvme: Minor style(9) fixes
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0<sys/systm.h> needs to be first after <sys= /param.h>. And we don't need
>=C2=A0 =C2=A0 =C2=A0both sys/param.h and sys/types.h.

We do not both sys/param.h and sys/systm.h as well, since sys/systm.h
includes sys/param.h.

=C2=A0 =C2=A0 =C2=A0Kernel includ= e files (sys/*.h) come first.=C2=A0 If either <sys/types.h> or
=C2= =A0 =C2=A0 =C2=A0<sys/param.h> is needed, include it before other inc= lude files.
=C2=A0 =C2=A0 =C2=A0(<sys/param.h> includes <sys/ty= pes.h>; do not include both.) Next,
=C2=A0 =C2=A0 =C2=A0include <s= ys/systm.h>, if needed.=C2=A0 The remaining kernel headers should be
= =C2=A0 =C2=A0 =C2=A0sorted alphabetically.

Should I = update it to say just include systm.h over param.h over types.h? Or is ther= e some other rule to follow that we should document? A quick survey suggest= s this is often the case, but a large minority of the time both or even all= three are included.

However, in this case, I need= ed to keep it separate because nvme.h is included by userland and I thought= systm.h was kernel only (without checking)... but systm.h does seem to hav= e all the proper guards to make that ok...

Warner= =C2=A0
--000000000000932612064480742d--