From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCUAq-0005lI-2d for qemu-devel@nongnu.org; Wed, 30 Jul 2014 09:44:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCUAg-0008OC-Sx for qemu-devel@nongnu.org; Wed, 30 Jul 2014 09:44:08 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:34302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCU4n-0006Zl-70 for qemu-devel@nongnu.org; Wed, 30 Jul 2014 09:37:53 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 30 Jul 2014 09:37:52 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 6E51D38C8056 for ; Wed, 30 Jul 2014 09:37:49 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by b01cxnp22034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s6UDbndd63176894 for ; Wed, 30 Jul 2014 13:37:49 GMT Received: from d01av03.pok.ibm.com (localhost [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s6UDbXHB020425 for ; Wed, 30 Jul 2014 09:37:33 -0400 Message-ID: <53D8F51D.6060600@linux.vnet.ibm.com> Date: Wed, 30 Jul 2014 09:37:33 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1406720068-16482-1-git-send-email-mst@redhat.com> <1406720068-16482-2-git-send-email-mst@redhat.com> In-Reply-To: <1406720068-16482-2-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] tpm: remove code duplication List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org 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 > --- > 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