From: "Luis R. Rodriguez" Subject: [PATCH 9/9] vtpm: guard against redefining TPM_VENDOR_COMMAND Date: Fri, 20 Nov 2015 09:47:52 -0800 Message-ID: <1448041672-3986-10-git-send-email-mcgrof@do-not-panic.com> References: <1448041672-3986-1-git-send-email-mcgrof@do-not-panic.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1448041672-3986-1-git-send-email-mcgrof@do-not-panic.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com, ian.campbell@citrix.com, JBeulich@suse.com Cc: Daniel De Graaf , samuel.thibault@ens-lyon.org, "Luis R. Rodriguez" , pryorm09@gmail.com, cfergeau@redhat.com List-Id: xen-devel@lists.xenproject.org From: "Luis R. Rodriguez" vtpm.c already includes tpm/tpm_marshalling.h, this in turn includes tpm_structures.h which already has defined TPM_VENDOR_COMMAND. Guard against its redefinition to avoid a compilation warning on vtpmc: cc -I../tpm_emulator-x86_64 -c -o vtpm.o vtpm.c In file included from vtpm.c:36:0: vtpm_manager.h:57:0: warning: "TPM_VENDOR_COMMAND" redefined #define TPM_VENDOR_COMMAND 0x02000000 // TPM Main, part 2, section 17. ^ In file included from ../tpm_emulator-x86_64/tpm/tpm_marshalling.h:21:0, from vtpm.c:31: ../tpm_emulator-x86_64/tpm/tpm_structures.h:526:0: note: this is the location of the previous definition Cc: Daniel De Graaf Signed-off-by: Luis R. Rodriguez --- stubdom/vtpmmgr/vtpm_manager.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stubdom/vtpmmgr/vtpm_manager.h b/stubdom/vtpmmgr/vtpm_manager.h index 2d2109dd63cb..6fdaf6aeb074 100644 --- a/stubdom/vtpmmgr/vtpm_manager.h +++ b/stubdom/vtpmmgr/vtpm_manager.h @@ -54,7 +54,10 @@ //************************ Command Codes **************************** #define VTPM_ORD_BASE 0x0000 +/* Defined in tpm_emulator-x86_64/tpm/tpm_structures.h */ +#ifndef TPM_VENDOR_COMMAND #define TPM_VENDOR_COMMAND 0x02000000 // TPM Main, part 2, section 17. +#endif #define VTPM_PRIV_BASE (VTPM_ORD_BASE | TPM_VENDOR_COMMAND) /* -- 2.6.2