From nobody Wed Sep 20 07:10:06 2023 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 4Rr8mt7525z4thvF; Wed, 20 Sep 2023 07:10:06 +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 4Rr8mt6cvMz3ZPs; Wed, 20 Sep 2023 07:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695193806; 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=4CEo2q+beCkXEqb57WiOutJ1yugt+XvQ7zIjWe7TMDk=; b=F/8p0s6ETffIfBp5yfs1aBbhhvTbK9I9bU1/phOvV8o5LH0BLAtKTny8Wyf9cc3/k9Ummp 3GEKd1Dcc1+JUgC/Red8kqhGKwESMmJfQWpNVbbOYT7JlRNBiZzepK1T+HUo06mSCXdiC/ 5vhPSxPz3f5xyfmZMvKuelkGSQmPWfmpQ1jof93+wplghoemF0AdUl7hkEZ26FhrJ4+iWS dWxZrsozaPkgNVKjzz2IS74Mg+tRIOpbtgCkn+TX3uuZ29qjTHMtQsNNpuKV14Ajjh4suD WBywjLoVwbyLlVNhB0kt1UGV9v9p9CFPQOKD48/YnO9aBKetzIiu5gvnR/ueIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695193806; a=rsa-sha256; cv=none; b=Js3Ya5TvvX5NRYrDe5etssVaorycTRwZiF8YNLqAknZdAv165hu6hcpVdmBkbqQ7ENSjoI fKQEnojdpzLWnti8hhEbE/WkTkpf7pZ3UYe4xj8H7kcqOOSEmQvxkmVPHby3hbDnm6xyeE 0AoDy+jQtu0owyz9h2oUHhFoKZS6U0gQ1lu/FGlEwyAPDpt0859Uk5ye+XAcJd3QuwLqJU Mq+V8ZGnyh+muYtTtetwY4Onl9w9BFU9yR2veZpxD3IP3MaeftfsRxAUAurjrNr/4rYbc8 mBhjp45ZgKV7vaTWDEFqoJvWvdVvV6G9/BWbue9dHbob+zdZnNnlBesFsLmwDQ== 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=1695193806; 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=4CEo2q+beCkXEqb57WiOutJ1yugt+XvQ7zIjWe7TMDk=; b=EccPWEDj2az8Gc6v4Z7fDodRwrNfR6h1SeOphYMCsqanyiAkruvr7ss6t42WZLrNcdyZbQ VSVfVKY6C8RrhNqxo48gBtRbB3W7HU66+KYTcFALidg1O9y9LwdVbntNAXugVlXve1yY6M ggWwkbF9qUahZjBZgYfFJx9Wwp7rQy57dDGup2mCB+V5A/TeIqRVUq8wplM7dctLx4AXu9 1P1LBDDTcyA4f0TB6K9eQPkW5VQD4kEWNxaEaSIusZi/omIbJW5AYYDhGW1mCiuKS+Y34I qKVgKMeDWE76uRxJoMfmWgsBVJ5rNAHJ6/5Z4nL8uzvbUj1IAsuzRgH4E4l7Iw== 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 4Rr8mt5bPyzm7c; Wed, 20 Sep 2023 07:10:06 +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 38K7A6no057189; Wed, 20 Sep 2023 07:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38K7A6i2057184; Wed, 20 Sep 2023 07:10:06 GMT (envelope-from git) Date: Wed, 20 Sep 2023 07:10:06 GMT Message-Id: <202309200710.38K7A6i2057184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 08862a1a5e14 - stable/12 - Fix geom build with clang 17 and KTR enabled 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 08862a1a5e14d49c221999a82e2a52690f918a97 Auto-Submitted: auto-generated The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=08862a1a5e14d49c221999a82e2a52690f918a97 commit 08862a1a5e14d49c221999a82e2a52690f918a97 Author: Dimitry Andric AuthorDate: 2023-09-12 06:52:31 +0000 Commit: Dimitry Andric CommitDate: 2023-09-20 07:04:10 +0000 Fix geom build with clang 17 and KTR enabled When building a kernel with clang 17 and KTR enabled, such as with the LINT configurations, a -Werror warning is emitted: sys/geom/geom_io.c:145:31: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] 145 | if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { | ~~~~~~~~~~~~~~~~~~~~~~~~ ^ sys/geom/geom_io.c:145:31: note: use '&' for a bitwise operation 145 | if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { | ^~ | & sys/geom/geom_io.c:145:31: note: remove constant to silence this warning Replace the multiple uses of the expression with one macro, and in this macro use "!= 0" to get a logical operand instead of a bitwise one. Reviewed by: jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41823 (cherry picked from commit 479d224efcbf0115f8cd84314fcc46cbac146a1d) --- sys/geom/geom_io.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 84a290dcc970..50db2f0c6639 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -67,6 +67,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define KTR_GEOM_ENABLED \ + ((KTR_COMPILE & KTR_GEOM) != 0 && (ktr_mask & KTR_GEOM) != 0) + static int g_io_transient_map_bio(struct bio *bp); static struct g_bioq g_bio_run_down; @@ -150,7 +153,7 @@ g_new_bio(void) bp = uma_zalloc(biozone, M_NOWAIT | M_ZERO); #ifdef KTR - if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { + if (KTR_GEOM_ENABLED) { struct stack st; CTR1(KTR_GEOM, "g_new_bio(): %p", bp); @@ -168,7 +171,7 @@ g_alloc_bio(void) bp = uma_zalloc(biozone, M_WAITOK | M_ZERO); #ifdef KTR - if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { + if (KTR_GEOM_ENABLED) { struct stack st; CTR1(KTR_GEOM, "g_alloc_bio(): %p", bp); @@ -183,7 +186,7 @@ void g_destroy_bio(struct bio *bp) { #ifdef KTR - if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { + if (KTR_GEOM_ENABLED) { struct stack st; CTR1(KTR_GEOM, "g_destroy_bio(): %p", bp); @@ -231,7 +234,7 @@ g_clone_bio(struct bio *bp) bp->bio_children++; } #ifdef KTR - if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { + if (KTR_GEOM_ENABLED) { struct stack st; CTR2(KTR_GEOM, "g_clone_bio(%p): %p", bp, bp2); @@ -260,7 +263,7 @@ g_duplicate_bio(struct bio *bp) bp2->bio_attribute = bp->bio_attribute; bp->bio_children++; #ifdef KTR - if ((KTR_COMPILE & KTR_GEOM) && (ktr_mask & KTR_GEOM)) { + if (KTR_GEOM_ENABLED) { struct stack st; CTR2(KTR_GEOM, "g_duplicate_bio(%p): %p", bp, bp2);