From nobody Sun Sep 17 12:14:54 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 4RpRgy4frbz4sWKc; Sun, 17 Sep 2023 12:14:54 +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 4RpRgy4DYHz3Ffq; Sun, 17 Sep 2023 12:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694952894; 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=TzysnTHW6+QCDDArxX7317w6shMEUh3WD8dx+bHZGEU=; b=O0+HB7URtXbsIe6bR9L5DvZqvzLHZHl7Jx/HjSHiZjZUHJsX5b9RUm9KUcl+4HEpP+Njdm f+e9A8iIRxGiPwBaAnQR6lkkContQpHRqbYneznN2GBPgOeY2N7pGqyMbHY30s9eNup40h qWS5wMD/OkHoCsmOJViC3ZmStHSxx8WeJqKrJOxz2E8oqSKa8S4e6CK3BniqHtoZm7V+LQ 5l6Mq4J8pKof/2zu6gzQjEwACDPfiP3BxsVnBOLInrBAb2lXVvN2ocrBEz1hIeFsNKquqi tGRKC/3XFw0VbNgjU4jqsTKWCv4nArLVwEL33ONXaEzwsCf07s7P3FCMx1WnBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694952894; a=rsa-sha256; cv=none; b=EXvufjR4NTc0qEEuszzL6HOZT8WR/APLqq2lmhVLfSN7N/MtG7GCHx+PHcBNn2W56fdiLr OcfxjQAYvd33P9FSAgi8x7w1fD+fN5bbiv65OFlIo09S188TmxuszSOUI/+A3LQDLVMwjJ ZFswO1S72piUdGF4sC3PYhnYapfpgg8PyUOZ56OL5nBm5Yk0mOmC0FE6vgIO9h4K3flLZG UVgZM9GAAvVORyJJMv8PzBsi9cPWsxa+Yeq+pnwivQsXQw+HkdcF16FSp5gIBMSDmbwF/D uAwLfA3OJjql5YODltA98i4Yr3gaOPLIFJ9bw6fPK6hX1RCBVLgT3VbQ+/lJZg== 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=1694952894; 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=TzysnTHW6+QCDDArxX7317w6shMEUh3WD8dx+bHZGEU=; b=nKLXDh7+eEEdooC1qSuU5rjLzJhgs9pH5M9N0tbCvg7s7HlVUW2avNX1dgfsd1r74mnV4e XgsJxmmrnAWIiTwhZq74QiOmhdWleptWKygZQ2bkgO4a5DTRuaGuAlaXTGd80pxc5KjXNz sv6j7t39wBjnzaWXrzE+bN5i8nwUW6uw40dXKb3R+Gzt/0Az87np574M0R706+Je4U5CyI gjifLa8FDQT8Dk2y4PjAagddUIKmtea2xSJlvOkZt3CWJ70zzWJ3YRzTK9gwVNcI76OF8N 5rySuJisMUgd0uXHPEU4bfPTTBIfGdN4W46ejMmWgFXjepGGEJmBO0c9t5/ibg== 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 4RpRgy304XznxP; Sun, 17 Sep 2023 12:14:54 +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 38HCEspP090304; Sun, 17 Sep 2023 12:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38HCEsxD090301; Sun, 17 Sep 2023 12:14:54 GMT (envelope-from git) Date: Sun, 17 Sep 2023 12:14:54 GMT Message-Id: <202309171214.38HCEsxD090301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 479d224efcbf - main - 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/main X-Git-Reftype: branch X-Git-Commit: 479d224efcbf0115f8cd84314fcc46cbac146a1d Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=479d224efcbf0115f8cd84314fcc46cbac146a1d commit 479d224efcbf0115f8cd84314fcc46cbac146a1d Author: Dimitry Andric AuthorDate: 2023-09-12 06:52:31 +0000 Commit: Dimitry Andric CommitDate: 2023-09-17 12:13:09 +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 --- 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);