From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanb@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 1/2] tpm: remove code duplication
Date: Wed, 30 Jul 2014 13:34:40 +0200 [thread overview]
Message-ID: <1406720068-16482-2-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1406720068-16482-1-git-send-email-mst@redhat.com>
Move TYPE_TPM_TIS to tpm.h so it can be used
by an inline function there.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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
next prev parent reply other threads:[~2014-07-30 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-30 11:34 [Qemu-devel] [PATCH 0/2] tpm: acpi generation tweaks Michael S. Tsirkin
2014-07-30 11:34 ` Michael S. Tsirkin [this message]
2014-07-30 13:37 ` [Qemu-devel] [PATCH 1/2] tpm: remove code duplication Stefan Berger
2014-07-30 11:34 ` [Qemu-devel] [PATCH 2/2] acpi: cleanups tcpa table generation Michael S. Tsirkin
2014-07-30 13:38 ` Stefan Berger
2014-08-11 12:49 ` Stefan Berger
2014-08-08 19:25 ` [Qemu-devel] [PATCH 0/2] tpm: acpi generation tweaks Stefan Berger
2014-08-10 20:04 ` Michael S. Tsirkin
2014-08-11 11:35 ` Stefan Berger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406720068-16482-2-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).