From nobody Wed Sep 20 07:04:32 2023 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 4Rr8fS4vwBz4thrK; Wed, 20 Sep 2023 07:04:32 +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 4Rr8fS4KwYz3YXm; Wed, 20 Sep 2023 07:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695193472; 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=8lB9kEKrNo1kkWBi9GDOgyEEWY7x5jo2yb4NGeMHKr0=; b=SuIXtOOMJRpJJhHkPjpaJ/SwUDYNlg1c7VPUXQF8VJV8yl62/TN6bOxuAvbmh8NdAe00fD 7sqtGkxpp+9JDkRl930VjmjCrlHMTSeHgdm65NzsYqfsoAjcEOgkm6du9GcN7TXDzvhy8j h0PrFy+0VBCZvZxhPK+SjjWtdLEuWS+TIjBVaMUUaVGp5Fx5FA+fV5go9pwMP+/KjCWtKK ZRC2EUEjXq0b186oPjDA+FXacNINEZKCN1867aw97wWhy1e0Ay2wGSvZZ5P2/tkLXoJoYE Al/+YNOU70gxPUdaKqX8sATIVgG/rBYOeWotycFmIUACBN8o28rQiZlTuFK9DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695193472; a=rsa-sha256; cv=none; b=w+sBHGJmf6k0JNiKoqYMKzZVZWo+QtDMeAhlADAD/xvhrrC/nxrA2c+hqQ+/O1K9JBeKKg 9MDBxQBZ76SzdpBFp+pH8qywcinO3XFsiy7bIGq0wD3I7hup2dCXxUphUhzoPR/uGHsufu MkY+++fgav/OV6dTiCFTjQV3mRYsSVnBQhwQ9XTs96idknezxogfr8ipE0O3er3yzdWh4S eRi1RLHkkwAXSTnDw6iI+QBLRSkLj8w1I/MrzoYCvn9Y/AJEUwLdeevFSoCJ//iQ+FM6/O lsoVAxkb/hfVYjV7FeNSDtLfp4MOmf4gx2syvUzAv65TAPvO+b7izy5IECX/Bg== 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=1695193472; 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=8lB9kEKrNo1kkWBi9GDOgyEEWY7x5jo2yb4NGeMHKr0=; b=IesDnfbaRuCff/318wTFo8kDiKdKgCpVELehMqoCuFAzmkQXT84jZvHnUZv22qtAI0zDA2 aBSkVI/Ac0tpCFYjXJAUozLemNKgMpGSDBUA5T/HlHkoUSGeARR1JN1OcC0R6j1RMHtpBl A8wn95Q95JGSCNh+F5CmqvK/AtBR/ZHlFyz16mpodRfhEOSYG18GjfqtM2OfJ2Fe/ZUiPg IkYvPhH6U9JOMjNK0zinAQQmshlyifvaWPhS6Fu24tzEH78lx0wtdAS7KQwccepKO4WvyK d2YnbgUV31S1Xk1KLeKbdDFQd5q2hqEGpyyjYR/bwjwngiPaIfdDJ9hEl2+XPQ== 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 4Rr8fS3FB6zmP6; Wed, 20 Sep 2023 07:04:32 +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 38K74W2b053249; Wed, 20 Sep 2023 07:04:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38K74WGo053246; Wed, 20 Sep 2023 07:04:32 GMT (envelope-from git) Date: Wed, 20 Sep 2023 07:04:32 GMT Message-Id: <202309200704.38K74WGo053246@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: b12c6876b429 - stable/14 - Fix geom build with clang 17 and KTR enabled 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: b12c6876b4294922175442c9206cd4e34819533b Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b12c6876b4294922175442c9206cd4e34819533b commit b12c6876b4294922175442c9206cd4e34819533b Author: Dimitry Andric AuthorDate: 2023-09-12 06:52:31 +0000 Commit: Dimitry Andric CommitDate: 2023-09-20 07:03:55 +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 2acf08517222..da8f917686ff 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -68,6 +68,9 @@ #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; @@ -142,7 +145,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); @@ -160,7 +163,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); @@ -175,7 +178,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); @@ -220,7 +223,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); @@ -249,7 +252,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);