]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge r357348 from the clang 10.0.0 import branch:
authordim <dim@FreeBSD.org>
Fri, 31 Jan 2020 19:36:14 +0000 (19:36 +0000)
committerdim <dim@FreeBSD.org>
Fri, 31 Jan 2020 19:36:14 +0000 (19:36 +0000)
commitfbaf16dba8bfb93841b7a38c10ef278d97c2667f
tree38af889c057b037e7b01abc3f82bfc9a0b8b16c0
parentcb6c6545f6f4be2be31f26817e2b07d22e18d00d
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.

MFC after: 3 days
sys/conf/files.amd64
sys/conf/kern.mk
sys/modules/tpm/Makefile