From owner-svn-src-head@freebsd.org Sat Feb 1 16:57:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F6741FBE58; Sat, 1 Feb 2020 16:57:05 +0000 (UTC) (envelope-from dim@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4890cd0yRNz3GbV; Sat, 1 Feb 2020 16:57:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 020121EF2; Sat, 1 Feb 2020 16:57:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011Gv4mP020123; Sat, 1 Feb 2020 16:57:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011Gv4Bp020121; Sat, 1 Feb 2020 16:57:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002011657.011Gv4Bp020121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Feb 2020 16:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357366 - in head/sys: conf modules/tpm X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/sys: conf modules/tpm X-SVN-Commit-Revision: 357366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 16:57:05 -0000 Author: dim Date: Sat Feb 1 16:57:04 2020 New Revision: 357366 URL: https://svnweb.freebsd.org/changeset/base/357366 Log: Revert r357349, since the clang 10.0.0 warning was actually correct, and the ! operator should have been a ~ instead: Merge r357348 from the clang 10.0.0 import branch: Disable new clang 10.0.0 warnings about converting the result of shift operations to a boolean in tpm(4): sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context] WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD); ^ sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD' #define TPM_CRB_CTRL_CANCEL_CMD BIT(0) ^ sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT' #define BIT(x) (1 << (x)) ^ Such warnings can be useful in C++ contexts, but not so much in kernel drivers, where this type of bit twiddling is commonplace. So disable it for this case. Noticed by: cem MFC after: 3 days Modified: head/sys/conf/files.amd64 head/sys/conf/kern.mk head/sys/modules/tpm/Makefile Directory Properties: head/ (props changed) Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Feb 1 11:31:45 2020 (r357365) +++ head/sys/conf/files.amd64 Sat Feb 1 16:57:04 2020 (r357366) @@ -323,8 +323,7 @@ dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm dev/tpm/tpm20.c optional tpm -dev/tpm/tpm_crb.c optional tpm acpi \ - compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" +dev/tpm/tpm_crb.c optional tpm acpi dev/tpm/tpm_tis.c optional tpm acpi dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Feb 1 11:31:45 2020 (r357365) +++ head/sys/conf/kern.mk Sat Feb 1 16:57:04 2020 (r357366) @@ -37,9 +37,6 @@ CWARNEXTRA+= -Wno-error-shift-negative-value .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member .endif -.if ${COMPILER_VERSION} >= 100000 -NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context -.endif .endif .if ${COMPILER_TYPE} == "gcc" Modified: head/sys/modules/tpm/Makefile ============================================================================== --- head/sys/modules/tpm/Makefile Sat Feb 1 11:31:45 2020 (r357365) +++ head/sys/modules/tpm/Makefile Sat Feb 1 16:57:04 2020 (r357366) @@ -11,5 +11,3 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_i SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include - -CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT}