From nobody Tue Jun 11 04:49:26 2024 X-Original-To: dev-commits-src-branches@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 4Vyx6G3fGCz5Ncyy; Tue, 11 Jun 2024 04:49:26 +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 4Vyx6G360fz54lM; Tue, 11 Jun 2024 04:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718081366; 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=uUCeRuhUJSkztkUveV/NPSp0ko2XRfS/KamdqW2gdLk=; b=KizvdMw4qtJP/ZmjA8e95Bi+Drh+Lcdr3BKZJfdDOneO7MWsSS9M9lq0b+wxd2HXVAcGwd P5bjjFEd3uWcrLCj/iZ16E1k5j2djH4MORox9f8gZmX/CRsRTZkOdUMMs3l6rZ9Izwsfmc KevgZjuuj2UwYWUwoB2nYWOFPcDxw+4w6cHPM+YTXP0yMdYs5RkIX2WycLWSIMHc6WTit6 ZuUG4ZasTbr2I1sNqWsVrvwJgIxBs1dDsubh/h/U2pur2PJaGP/vGiYwsy3UjF1VDE0R4J ABsYcoqqXN8i3l9KYqvskO0yj7mp8IxOa/PMp05wchpV+XxJ/8BKCkw47gq0gQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718081366; a=rsa-sha256; cv=none; b=CAwPAHVXlUb6YZ7yByyD/SVxb+fbtgmZXFmn2k3ZXM+q/JBmar27bUZ4cooNQBN+yeQLjy 7V6JR4DxZOzAyOpnHNGHw4tfCUf6+F2iDINdYbJrs8rJGa1USHquvNBGc7M7WMT4eLN729 aaD3M3WkpZsBLEB1CbpxgXtIf1HO1Ie89iBmNZDVxyYHNcMpqvNENrIZZEdHVr86P8Zbn3 gINQT7IQIC7Mfw/kcUg2303bimQ8KaBvmp3xb7WEoaGryfXuobx+H9HIiG2m9ShLEfU70g HxU8b3C44EH/01x0pv1tx/lT+QdfTF7PvWo+0WEJrvMKvqR0QJ+oJQLfM6kqFQ== 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=1718081366; 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=uUCeRuhUJSkztkUveV/NPSp0ko2XRfS/KamdqW2gdLk=; b=N7kMkf9nnUsV2TrWA3QKMCmSE/AS69pJgzAtPBwXOnx5YzIpyczl989QcWglkMfCIIYsCu YdT+Dy1/t3gIgguo+EUbDDKd2WuiFrrxtn+7tOyEpezzmdH7D52U+FuhxCai7XI3HdbgJE AlSRlldNR35cbtQwt+H3AA/X8+L6/wXjnP/VKBRyqR6ku/It70ElSRGFaZSx9/H/jzjHGz 4hrUwynpOTEHPT0Te3k1qQfLx2sTpxlxVjxd6AF90RaPpjrqC9bVZnUIpxWEKIcAF+MWiL 1nETl33SI+940c8IjlkAYWjZEVcwR2HVQi8mb8FdgYCkoUstBGwNSOOjWp6NDw== 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 4Vyx6G2hsXzvkM; Tue, 11 Jun 2024 04:49:26 +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 45B4nQMi092247; Tue, 11 Jun 2024 04:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45B4nQJ6092244; Tue, 11 Jun 2024 04:49:26 GMT (envelope-from git) Date: Tue, 11 Jun 2024 04:49:26 GMT Message-Id: <202406110449.45B4nQJ6092244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 9cd77bd9c68b - stable/14 - sys/sysctl.h: Fix wrong assertion with multiple access flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9cd77bd9c68bda6134c6672e9a923869b7923343 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9cd77bd9c68bda6134c6672e9a923869b7923343 commit 9cd77bd9c68bda6134c6672e9a923869b7923343 Author: Zhenlei Huang AuthorDate: 2024-06-08 03:21:11 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-11 04:48:59 +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 (cherry picked from commit 23f4131ad685debef98566351cb9f0e0a5903903) --- 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 bc7a2bc601a1..76cbae25f4e5 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -395,14 +395,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 | \