From nobody Sat Jun 08 03:22:22 2024 X-Original-To: dev-commits-src-all@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 4Vx3KC03wRz5NB65; Sat, 08 Jun 2024 03:22:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vx3KB3yRgz42hw; Sat, 8 Jun 2024 03:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717816942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xFRyWyL3ZOUI/QvQi5ENAATEZtc231yLTMcgr8HiNI=; b=TaxjzaE81IWBgW0gcvKCdB+NoL2DfPdeYapSPyiPRu/RvsfyN6Z17IU6u3G1vyiqsekkuO 4/q/v3k4wKtXDT0XgHrBHGta4ib/CSwwgZIkly1h4UPdhTvWjOSXOHm+tn2OdEi9QQcyDI UyoeIzDNKjFUuTlF8UtSKU5cR2VDa/+c0jfk7ocwG/fomvwzselab2DgOuQ6ZzFEu2V0Sx Wf6nly91ARFY+vjmjb6hbRUpcKb4vz/wOq7EcdMHEQF7SHXY9YyFH/YbokvVk5zWTxa4R1 j/eLmcK+Fj5EUC3OMwCmx+acU7frhwDGTjSvau0ndpZ5jYnkqQ111ccFa/NxTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717816942; a=rsa-sha256; cv=none; b=ta+FKwcPVz1DIOIc0rceTeEXov2eU8hmqDSxw3jCV11/1Z8djSBzXesxkdf/QP+WY7H4F6 XJbnu/KZAEnnScpM3fBU+uofEumzWMDo8OFVqrpzBKZWlBxNOw1fZJbh7r12+/qPq7vZoX t6UCYel/Y4+nCn+bQEuQ4XieLTSY6Q6aLtDKbyxxi3yxe5ubzhOsABwo4QKfB3zwl9WPxH b042i/fn4LA1S7yYAJCbpcWwDvgK5e5sGEMi8uAYqE3oqPW4GgKHnzyqyfZHXP0BbeGNzA pAyhihgz+LAW7XZeWVGr1ih1rHKyN1J8Qm699LHCT57PWllfxxsa/nSkXL2JrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717816942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5xFRyWyL3ZOUI/QvQi5ENAATEZtc231yLTMcgr8HiNI=; b=rSZYLdkqThI7GwzNpH10M+QppSRy9awU2x3Vvc5SBFUcxetg4wz1j6c7hJXGWwJnrth7bR YVssowD7avhY5nFucJ9HbopoEAa4oH+8gmUMbLIuqV1J9w6ODl8AqGTYZu6UtfiNpYzwoA oPSXhXVrT3hEYZqekZGClohZ/iAX1cO4AdKkXgZNHc/4RLFbjKqZEeFAn8B3Em1LEXREpe BgkcBw+uJoCarLXi3so1HhGKtnHmC0XbmyY30UdXBTEpLlUtjcFSeo/QUaGrH2zJVFOUGU PqK5hW3/InaBDX5Ab3KJsxi7+p3ijhZETJHEV4vonljH9XlJEFMHvRASUQ8o/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vx3KB34nTzhXT; Sat, 8 Jun 2024 03:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4583MMiq056328; Sat, 8 Jun 2024 03:22:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4583MMkw056325; Sat, 8 Jun 2024 03:22:22 GMT (envelope-from git) Date: Sat, 8 Jun 2024 03:22:22 GMT Message-Id: <202406080322.4583MMkw056325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 23f4131ad685 - main - sys/sysctl.h: Fix wrong assertion with multiple access flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23f4131ad685debef98566351cb9f0e0a5903903 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=23f4131ad685debef98566351cb9f0e0a5903903 commit 23f4131ad685debef98566351cb9f0e0a5903903 Author: Zhenlei Huang AuthorDate: 2024-06-08 03:21:11 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-08 03:21:11 +0000 sys/sysctl.h: Fix wrong assertion with multiple access flags With multiple flags passed in, e.g., CTLFLAG_RD | CTLFLAG_CAPRD, due to the precedence rules, this will result in false positive assertion. Fix that by surrounding the replacement lists with parentheses. Reviewed by: imp, erj Fixes: 10a1e981d411 iflib: mark isc_driver_version as constant MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45531 --- sys/sys/sysctl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index d80e0fbbe2e4..7b27cb307e0c 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -393,14 +393,14 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define SYSCTL_CONST_STRING(parent, nbr, name, access, arg, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING | CTLFLAG_MPSAFE | (access),\ __DECONST(char *, arg), 0, sysctl_handle_string, "A", descr); \ - CTASSERT(!(access & CTLFLAG_WR)); \ + CTASSERT(!((access) & CTLFLAG_WR)); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING) #define SYSCTL_ADD_CONST_STRING(ctx, parent, nbr, name, access, arg, descr) \ ({ \ char *__arg = __DECONST(char *, arg); \ - CTASSERT(!(access & CTLFLAG_WR)); \ + CTASSERT(!((access) & CTLFLAG_WR)); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING); \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING | \