Message ID | 1406720068-16482-2-git-send-email-mst@redhat.com |
---|---|
State | New |
Headers | show |
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 <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 */ ACK
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 */
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(-)