Received: from eggs.gnu.org ([2001:4830:134:3::10]:47236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02m3-000570-KX for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:07:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z02ly-0004U6-Lu for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:07:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02ly-0004Tz-Hi for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:07:34 -0400 From: Juan Quintela In-Reply-To: <1433268322-1290277-1-git-send-email-stefanb@linux.vnet.ibm.com> (Stefan Berger's message of "Tue, 2 Jun 2015 14:05:22 -0400") References: <1433268322-1290277-1-git-send-email-stefanb@linux.vnet.ibm.com> Date: Wed, 03 Jun 2015 09:07:32 +0200 Message-ID: <878uc1tgln.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] tpm: Prevent a call to TPM if no TPM support is requested Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Berger Cc: peter.maydell@linaro.org, stefanb@us.ibm.com, qemu-devel@nongnu.org, mst@redhat.com Stefan Berger wrote: > Prevent the function tpm_tis_get_tpm_version() from being called > if not TPM support is requested. > > Signed-off-by: Stefan Berger > --- > include/sysemu/tpm.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h > index c143890..c8afa17 100644 > --- a/include/sysemu/tpm.h > +++ b/include/sysemu/tpm.h > @@ -32,11 +32,13 @@ TPMVersion tpm_tis_get_tpm_version(Object *obj); > > static inline TPMVersion tpm_get_version(void) > { > +#ifdef CONFIG_TPM > Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL); > > if (obj) { > return tpm_tis_get_tpm_version(obj); > } > +#endif > return TPM_VERSION_UNSPEC; > } I sent basically the same patch to mst and to the list. I don't care which one is picked. Thanks, Juan.