qemu-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH 1/2] tpm: remove code duplication
Date: Wed, 30 Jul 2014 09:37:33 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/30/2014 07:34 AM, Michael S. Tsirkin wrote:
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 */

ACK




reply via email to

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