qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] tpm: remove code duplication


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PATCH 1/2] tpm: remove code duplication
Date: Wed, 30 Jul 2014 13:34:40 +0200

Move TYPE_TPM_TIS to tpm.h so it can be used
by an inline function there.

Signed-off-by: Michael S. Tsirkin <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]