From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCS9P-0001hD-3k for qemu-devel@nongnu.org; Wed, 30 Jul 2014 07:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCS9I-0001Ar-Oj for qemu-devel@nongnu.org; Wed, 30 Jul 2014 07:34:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCS9I-0001Ak-Hq for qemu-devel@nongnu.org; Wed, 30 Jul 2014 07:34:24 -0400 Date: Wed, 30 Jul 2014 13:34:40 +0200 From: "Michael S. Tsirkin" Message-ID: <1406720068-16482-2-git-send-email-mst@redhat.com> References: <1406720068-16482-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406720068-16482-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] tpm: remove code duplication List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanb@linux.vnet.ibm.com Move TYPE_TPM_TIS to tpm.h so it can be used by an inline function there. Signed-off-by: Michael S. Tsirkin --- hw/tpm/tpm_tis.h | 3 --- include/sysemu/tpm.h | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/tpm/tpm_tis.h b/hw/tpm/tpm_tis.h index 6cdac24..1a0db23 100644 --- a/hw/tpm/tpm_tis.h +++ b/hw/tpm/tpm_tis.h @@ -29,9 +29,6 @@ #define TPM_TIS_BUFFER_MAX 4096 -#define TYPE_TPM_TIS "tpm-tis" - - typedef enum { TPM_TIS_STATE_IDLE = 0, TPM_TIS_STATE_READY, diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 7030109..9b81ce9 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -20,9 +20,11 @@ int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); int tpm_init(void); void tpm_cleanup(void); +#define TYPE_TPM_TIS "tpm-tis" + static inline bool tpm_find(void) { - return object_resolve_path_type("", "tpm-tis", NULL) != NULL; + return object_resolve_path_type("", TYPE_TPM_TIS, NULL); } #endif /* QEMU_TPM_H */ -- MST