From nobody Wed Apr 27 15:50:51 2022 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 BD0361AB93C9; Wed, 27 Apr 2022 15:50:53 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpNWc6bl3z3s2l; Wed, 27 Apr 2022 15:50:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x233.google.com with SMTP id q8so1983501oif.13; Wed, 27 Apr 2022 08:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bAsJSlMO01AkupxJyUShqo9eWYafkSiWvxuSOBNd57M=; b=QDBA/3m5/fCIdhGchhA3LvwDlOQiMhG0iZ5IWwTFsr/dRGKcB8shQAyyDfpqVANxo7 iNAw+iG1wySUSTRvGZmzNfSYtB+N0SmRvc73AKRL8WXT2iT4Qmq6VMy4At1ulaeaunqR knWy7DIzNRC8kTR6e5NOREuRC+ehx31qJIMNYFsHtgp43kvCiawIrufHGzTWroOKb9ov uQjEYjtt/uQebWqNZ6K2PMFPQgCAn/D6SBJz8CQWe2FTPiKhsPMg/+dc/138P5eFasGv jRo1qEltUzKyJAtwabk+Uk449LKBGZkFsVeErAfRjXE9pKEMJmaesFII/29EuarzYVt/ 28hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bAsJSlMO01AkupxJyUShqo9eWYafkSiWvxuSOBNd57M=; b=iYovXTxt+ORVOrdeVGLHrw5u/p0C9AXj6fz50k32/ppNN9LgnvaBoi2SQlrx0LvM0H poRrqiJ93ign4CvkLcE4u4YGgPm0n1LM+I7zP3nIjGaPacCRGRwx4CVHaiVmmAwt8oBW D+4+J9mi0LR8JzRn+nv9AXN3jSu/2kXq/aswt7ltm9lcuMOGYWxRI9xrbhf4/gNUtwqm mw9EjEro5iM8zJuWKElZsbv2aTiVfmMEPo2pyTQxPOETgnS1gM+SP1RssQWjKt2JT8Jo 0FfaXX261zsUZa2yoxWJbFp6R8Sgaz3eoZDrCYVh9nTjLihGr87yZzPJIDARBM2NFr2O CYig== X-Gm-Message-State: AOAM533Yw8JEeTnrWqQbukS0LpA2tIiH4Jy7+JhmhD6Y/LMN/UmzmdDF D5WnMhpxHi3LrPdmEfTATOYIEGB4sqR4dmuq5E0GoM6j X-Google-Smtp-Source: ABdhPJyh3CkNeNFs25ebTesZMQUe2dSUomcciiFg5ekd4ZH8RY8ixbqrC8CyCkLFlFAcqEaylgsOuwgHPS+NqvBKqCA= X-Received: by 2002:a54:4688:0:b0:325:9a36:ecfe with SMTP id k8-20020a544688000000b003259a36ecfemr360964oic.96.1651074652090; Wed, 27 Apr 2022 08:50:52 -0700 (PDT) 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 Received: by 2002:a8a:d82:0:b0:422:d8ed:35a0 with HTTP; Wed, 27 Apr 2022 08:50:51 -0700 (PDT) In-Reply-To: <0dbcc859-69b1-4850-11c3-f8a4acf5bde9@FreeBSD.org> References: <202204271330.23RDUHwN063641@gitrepo.freebsd.org> <0dbcc859-69b1-4850-11c3-f8a4acf5bde9@FreeBSD.org> From: Mateusz Guzik Date: Wed, 27 Apr 2022 17:50:51 +0200 Message-ID: Subject: Re: git: b40c0db6f6d6 - main - Patch up __diagused for when only one of INVARIANTS or WITNESS is defined To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4KpNWc6bl3z3s2l X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="QDBA/3m5"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::233 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.06 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.94)[0.937]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::233:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N On 4/27/22, John Baldwin wrote: > On 4/27/22 6:30 AM, Mateusz Guzik wrote: >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=b40c0db6f6d61ed594118d81dc691b9263a7e4d7 >> >> commit b40c0db6f6d61ed594118d81dc691b9263a7e4d7 >> Author: Mateusz Guzik >> AuthorDate: 2022-04-27 13:29:12 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2022-04-27 13:29:12 +0000 >> >> Patch up __diagused for when only one of INVARIANTS or WITNESS is >> defined >> >> Reported by: John F Carr >> --- >> sys/sys/systm.h | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/sys/sys/systm.h b/sys/sys/systm.h >> index f2ffa7e6b815..6ca9ee886562 100644 >> --- a/sys/sys/systm.h >> +++ b/sys/sys/systm.h >> @@ -554,10 +554,13 @@ void _gone_in_dev(device_t dev, int major, const >> char *msg); >> #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) >> #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) >> _gone_in_dev(dev, major, msg) >> >> -#if defined(INVARIANTS) || defined(WITNESS) >> -#define __diagused >> -#else >> +#if !defined(INVARIANTS) && !defined(WITNESS) >> +#define __diagused __unused >> +#elif ((defined(INVARIANTS) && !defined(WITNESS)) || \ >> + (!defined(INVARIANTS) && defined(WITNESS))) >> #define __diagused __unused >> +#else >> +#define __diagused >> #endif > > Hmm, could this just be: > > #if defined(INVARIANTS) && defined(WITNESS) > #define __diagused > #else > #define __diagused __unused > #endif > it does boil down to it and if you want to make the change I'm not going to stand in the way, but then imo it should get a comment that there is no dedicated macro for invariants or witness only so some warnings are possibly silenced when they should not be however, the point here is that the case of only one of these being defined is distinct from the rest and may warrant special treatment. I wanted to preserve the distinction in the, arguably hairy, conditional. -- Mateusz Guzik