From nobody Wed Sep 20 07:09:45 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 4Rr8mV0X8Rz4tj5q; Wed, 20 Sep 2023 07:09:46 +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 4Rr8mV02lmz3Z62; Wed, 20 Sep 2023 07:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695193786; 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=kwYeeUY8VerVP/jmI4sKONep3nDWSlwTXLL9uX+mrYA=; b=weGARLwBAXpDmlzB1rpAThPUiITYfuduoUeVpINetgMLt3HAFuKndBO5sn3TutHFWuYHCv yCwGp9XKwO5dTDhinkqLZ6O1owvmJH16qxszbGFV8cbH6ODh4hsrG/drglAH9S9hnyr2pm l3qWZZtJT/vr4IRoDyVM656zqH5kO7uz49hZvh5FF6JlyGvEvaUYeeQWA7mdbYkjpQgEMV OQv6O9KEyLpX/56KiXq0Uhao3rYIfnydM6eHRgc/8KQWglshG8bQzBZCvSv2K6JEnJ0pPh duD5wZFGTfiYMynnSDgSJRJRDN1qFiALOUFPV826gQiHywxYEeGb5mWjUK5Q7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695193786; a=rsa-sha256; cv=none; b=gDtSitrirbfz5+tk57d24N1wFrzkIIg6KWHNhi719niMugyoU4h30uyIkdZkxB4if0tEWp c9nV/ZukcPIBu45HaYPA0GIuNJkF07M55T/bz2GB/izLbwK5iFIXfPD41wI6SVgxoM80IY D5E4JplW88DJ2NnQi8AbfwomgjSkE+CPp7Du6SNz3Utnyu2z8lsLuiVhQQnjAUYTX7lUFg gtcVEXS0hUh9p4orda3IpDyDu87wqYWXN8hcIe2tBYtLaZI/R/HaPBWNtQBAmkkuCUByfu M05vnMl122e+cafIGw1ine1APpXP+CtkwEd4f8J3DS89+qDG4pMxN+38E5BIaQ== 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=1695193786; 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=kwYeeUY8VerVP/jmI4sKONep3nDWSlwTXLL9uX+mrYA=; b=fvScttq0sc2AJRW37iv+YwqxXsSPfMzjigqQa0VvddqPTDiABFHv3opEYGDD4opdxhuc0z YrUaRHaFy9quESz37qXsjAox8ZbhFBLVxgAqeqKRzaaS0g9heAllZGmvaRihIlhTsKFmuJ y02vTZ1FDnZlT05HtZyZa750smqm03TgoFjwutlFRbu8OvLxv30mzj3JMAm7JInA9zJsGM EPx28cUHyjGfDur9ekOQS+Zrtq2OGihEBxu/QbDp0U0ioP35exwLTPbTtpqcqHaL900pV+ 8F44sgLfyNwoDTOMep2FfsFItNYHhRNhiN9Q7YHAOHRmPjXo2CdYlDoGPJKCJA== 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 4Rr8mT6F1Czm7Z; Wed, 20 Sep 2023 07:09:45 +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 38K79jE0054082; Wed, 20 Sep 2023 07:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38K79jKx054079; Wed, 20 Sep 2023 07:09:45 GMT (envelope-from git) Date: Wed, 20 Sep 2023 07:09:45 GMT Message-Id: <202309200709.38K79jKx054079@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: c3e092dacbc8 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: c3e092dacbc8ba38c0be175f95403b3b15da736f Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c3e092dacbc8ba38c0be175f95403b3b15da736f commit c3e092dacbc8ba38c0be175f95403b3b15da736f Author: Dimitry Andric AuthorDate: 2023-09-12 06:52:31 +0000 Commit: Dimitry Andric CommitDate: 2023-09-20 07:04:02 +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 70c5809ae8eb..914b5807e6e0 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -67,6 +67,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; @@ -141,7 +144,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); @@ -159,7 +162,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); @@ -174,7 +177,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); @@ -219,7 +222,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); @@ -248,7 +251,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);