From nobody Tue Feb 28 18:55:41 2023 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 4PR65C2S6Nz3tnrN; Tue, 28 Feb 2023 18:55:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PR65C1vJPz3pG5; Tue, 28 Feb 2023 18:55:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677610543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zfpn0iqGvx4N2lhVoAQ5Zi+x+f+6Nw5yKYVxyESpqPQ=; b=IuX6VuxK6sbJJIKQdpkyvZHCqWgOcgvDjDmymP2aSuxo+y/wW/9iwRqwgdP2pdE0JpVT7q uMafhTjMzSpKp87xi+w++ZthQ/o5a9+xXLswXTz9tEInQINza0XJ7w9tesDnajeD0/kUA2 v7PUe+0OE1rpmTMLtzQBHDgVI+DfvYUWHwdf3fcYK5Oty8vVQqf8WJR2Hw1NQbANn5qjs4 0J8swON+Zb9iIzwLPSu1XwMo/gqbvKhsxBM0OYJYHARfIjVF4qFH2CNN4CzxnCTgbHMhC2 hYpsH2v1zetYq5N8QFSBDDq6SYdoNVMzgkfPObauS6I0N2cPmBm4Sdsy4VWJXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677610543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zfpn0iqGvx4N2lhVoAQ5Zi+x+f+6Nw5yKYVxyESpqPQ=; b=Z6+MoK17eM02KHyHoTa8q+xMm9qrZAPIIJztN3eu7R1ZgUyR6lJ3vHZX+2wvT3ecDIpyIa wIRU4pYdcz/z/Drc648pXSPbUPkt8trVPSnmM2RkpBZ+QEvvogzouoV2F4Fhq7xVgHRYLa RjcQNrHJvGBAqiQeSU8s/XkFcBGS1w5ZoH0XEm414eED22eGXnhdhKcJbE4U8V2pOGql1Y D//jaNQLlLZ+OkDdaMRyNjGqo9c5AutMbPflm+AOoaE51hZ7WGX3/Fk4mwdJJTm4PgX0c2 gJsoXpJ5sXKbpXK4mwv2ryAAlDHOh0gfj3wX28babu9s7DxZjL1hg3H6IHPOXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677610543; a=rsa-sha256; cv=none; b=XSYK5Mv20J8N5icHWuTRl/XTfbssTJW7qfz6fL7+dLFGPfRAAoEm+6Uw2r/furyr8zWeWN NhyemxbFzAHkcsZThB0Uu8xydD22yIAFeEFr0J1bAzJA950oFhdC+prif53ULLAflIiE2+ qSw4cFsXBee+zaL8uK/gZvAk5DQ+gb/d0+wN2Ht3TxfA4jxjbY9Ivl/wHWobjmahZY+M97 jAMw0O83Aqd6QRILG47tKvxDX/tn6zSEZCPUv9nhso7CVd2psVHEffzi7+ZXPr+vwbqT6B jBLu+0z5kOHnzphCg0ViM/tUIroTctsKDbUMXwjzFtRHWKKSmTvK1WMU68s8qQ== Received: from [IPV6:2601:648:8680:16b0:a594:db9f:33a9:7aa1] (unknown [IPv6:2601:648:8680:16b0:a594:db9f:33a9:7aa1]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PR65B3W0rzfXD; Tue, 28 Feb 2023 18:55:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <8ceb993e-1589-fd24-1786-4438acb9a07f@FreeBSD.org> Date: Tue, 28 Feb 2023 10:55:41 -0800 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: git: 68912701700c - main - ffs_suspend.c: clean up includes Content-Language: en-US To: Konstantin Belousov , Mateusz Guzik , markj@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202212292056.2BTKuOIu047460@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 1/3/23 3:53 AM, Konstantin Belousov wrote: > On Mon, Jan 02, 2023 at 06:29:57PM +0100, Mateusz Guzik wrote: >> On 12/29/22, 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 >>> AuthorDate: 2022-12-28 18:17:53 +0000 >>> Commit: Konstantin Belousov >>> 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. >>> >>> 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 >>> __FBSDID("$FreeBSD$"); >>> >>> -#include >>> #include >>> #include >>> -#include >>> -#include >>> -#include >>> #include >>> +#include >>> #include >>> +#include >>> #include >>> +#include >>> >>> #include >>> >>> >> >> tinderbox fails the KCSAN et al kernels: >> >> In file included from /usr/src/sys/ufs/ffs/ffs_suspend.c:36: >> In file included from /usr/src/sys/sys/systm.h:44: >> In file included from ./machine/atomic.h:73: >> /usr/src/sys/sys/atomic_san.h:117:24: error: unknown type name 'uint8_t' >> ATOMIC_SAN_FUNCS(char, uint8_t); >> ^ >> it bisects to this commit >> > So the problem is that sys/systm.h includes machine/atomic.h which always > had the pre-requisite sys/types.h, and this is documented in atomic(9). > But sys/atomic_san.h uses C89 types in prototypes, not just macros, and > this breaks for real. > > I can > 1. Just add sys/types.h to ufs_suspend.c (I prefer not) > 2. Add sys/types.h to sys/atomic_san.h. > 3. Add sys/types.h to sys/systm.h. > > IMO #2 is not the best solution, since it pollutes systm.h only sometimes, > when the right kernel options are used. I would prefer #3, it seems, but > want to ensure that there is a consensus about the addition to sys/systm.h. FYI, I got a different ream of breakages downstream in CheriBSD due to this commit removing param.h as well. I also only ever recalled Bruce telling me to do either or first (and only one of them). I don't recall any special rules for . CheriBSD has a local diff that tries to sort headers in systm.h which is why we get larger breakage: --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -41,13 +41,22 @@ #define _SYS_SYSTM_H_ #include -#include -#include #include #include #include #include /* for people using printf mainly */ +#include +#include I think if we want to be self-contained we should swap for . I think moving the includes down would also be more consistent with style(9) as well. -- John Baldwin