From owner-svn-src-all@freebsd.org Fri Jan 31 21:13:59 2020 Return-Path: Delivered-To: svn-src-all@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 7FB361ECF6A; Fri, 31 Jan 2020 21:13:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488VMW2qXkz4Dhs; Fri, 31 Jan 2020 21:13:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f65.google.com with SMTP id 77so7957910oty.6; Fri, 31 Jan 2020 13:13:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=snQXM9XjQQbK9DZVwvVFCDDvfiWUNBrI8KLGQU12gxo=; b=E1Ayodcb5aOPlRs1y4PYuY8n16i7pMmWBPwn64WtdOu8zJc/xB4F5nJRTBOlPnP/pJ qpFIX3/ohoBfo2Dn2Vph94Qz29rNFsxLDYLeH3tXYqFdVFddJZkaPkHsz0YsEJKa42Ad iE1rZuvbQAryPqJN/+SRCeuX1+WwLR6ofWOqtqpy/U7eHqZvULDhKcXZBlcDTozmI+OT GNHbUDtNpvoWAkVsi1FfvwQ2OWRR4UH6InI2FB9j4eR5s1ctBk0YEmNV1kVIF1yDRz1t 3/kSIUeKqJ/DbXs6Vinr6sOaZG8yagQfV+C5BKWfL6LCHyhCp3SA5KM/mLXJqFj2Ve1B yiag== X-Gm-Message-State: APjAAAXJ6M+dz7XAwHts6L5mJPSeTwBRRrSPnMdzZeRM1K7ExF1uVejm PmBa6yPGZ4BCgeZMdDGAiMJWQQ8U X-Google-Smtp-Source: APXvYqxebGcfF6HePImilOgl4RB6p5ePr5LEZ5NP6XWs3vTEBpaP/6jUWyVKRknqIXRmmB+oZRGsGQ== X-Received: by 2002:a9d:6e8f:: with SMTP id a15mr8888959otr.178.1580505237896; Fri, 31 Jan 2020 13:13:57 -0800 (PST) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com. [209.85.167.179]) by smtp.gmail.com with ESMTPSA id m15sm3423659otr.65.2020.01.31.13.13.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Jan 2020 13:13:57 -0800 (PST) Received: by mail-oi1-f179.google.com with SMTP id c16so8691961oic.3; Fri, 31 Jan 2020 13:13:57 -0800 (PST) X-Received: by 2002:aca:3017:: with SMTP id w23mr7301468oiw.152.1580505236931; Fri, 31 Jan 2020 13:13:56 -0800 (PST) MIME-Version: 1.0 References: <202001311936.00VJaEDP056807@repo.freebsd.org> In-Reply-To: <202001311936.00VJaEDP056807@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 31 Jan 2020 13:13:45 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357349 - in head/sys: conf modules/tpm To: Dimitry Andric Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 488VMW2qXkz4Dhs X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 21:13:59 -0000 Hi Dimitry, Do you think maybe the intent is to use ~TPM_CRB_CTRL_CANCEL_CMD instead? Plain "0" might also make sense. But I think the compiler is right here and the warning should not be disabled =E2=80=94 !BIT(foo) doesn't really make sense for a register. It happens to affect the right bit only because CANCEL_CMD is BIT(0). Thanks, Conrad On Fri, Jan 31, 2020 at 11:36 AM Dimitry Andric wrote: > > Author: dim > Date: Fri Jan 31 19:36:14 2020 > New Revision: 357349 > URL: https://svnweb.freebsd.org/changeset/base/357349 > > Log: > 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)) !=3D 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_CA= NCEL_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 i= t > for this case. > > 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/files.amd64 Fri Jan 31 19:35:21 2020 (r357348) > +++ head/sys/conf/files.amd64 Fri Jan 31 19:36:14 2020 (r357349) > @@ -323,7 +323,8 @@ dev/syscons/scvesactl.c optional s= c 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 > +dev/tpm/tpm_crb.c optional tpm acpi \ > + compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}" > 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/kern.mk Fri Jan 31 19:35:21 2020 (r357348) > +++ head/sys/conf/kern.mk Fri Jan 31 19:36:14 2020 (r357349) > @@ -37,6 +37,9 @@ CWARNEXTRA+=3D -Wno-error-shift-negative-value > .if ${COMPILER_VERSION} >=3D 40000 > CWARNEXTRA+=3D -Wno-address-of-packed-member > .endif > +.if ${COMPILER_VERSION} >=3D 100000 > +NO_WINT_IN_BOOL_CONTEXT=3D -Wno-int-in-bool-context > +.endif > .endif > > .if ${COMPILER_TYPE} =3D=3D "gcc" > > Modified: head/sys/modules/tpm/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/modules/tpm/Makefile Fri Jan 31 19:35:21 2020 (= r357348) > +++ head/sys/modules/tpm/Makefile Fri Jan 31 19:36:14 2020 (= r357349) > @@ -11,3 +11,5 @@ SRCS+=3D tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.= h acpi_i > SRCS+=3D tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h > > .include > + > +CWARNFLAGS.tpm_crb.c+=3D ${NO_WINT_IN_BOOL_CONTEXT}