From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2yPB-0007Lx-8H for qemu-devel@nongnu.org; Fri, 13 Oct 2017 07:45:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2yP7-0002sf-1r for qemu-devel@nongnu.org; Fri, 13 Oct 2017 07:45:29 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59670) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2yP6-0002rq-O4 for qemu-devel@nongnu.org; Fri, 13 Oct 2017 07:45:24 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9DBjFmt135732 for ; Fri, 13 Oct 2017 07:45:22 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2djvv7g2hu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 13 Oct 2017 07:45:21 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Oct 2017 07:45:20 -0400 From: Stefan Berger Date: Fri, 13 Oct 2017 07:44:51 -0400 In-Reply-To: <1507895100-26457-1-git-send-email-stefanb@linux.vnet.ibm.com> References: <1507895100-26457-1-git-send-email-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1507895100-26457-3-git-send-email-stefanb@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL v3 02/11] tpm-backend: Remove unneeded member variable from backend class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , amarnath.valluri@intel.com, marcandre.lureau@gmail.com, Stefan Berger From: Amarnath Valluri TPMDriverOps inside TPMBackend is not required, as it is supposed to be a= class member. The only possible reason for keeping in TPMBackend was, to get th= e backend type in tpm.c where dedicated backend api, tpm_backend_get_type()= is present. Signed-off-by: Amarnath Valluri Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Berger Signed-off-by: Stefan Berger --- hw/tpm/tpm_passthrough.c | 4 ---- include/sysemu/tpm_backend.h | 1 - tpm.c | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index 9234eb3..a0baf5f 100644 --- a/hw/tpm/tpm_passthrough.c +++ b/hw/tpm/tpm_passthrough.c @@ -46,8 +46,6 @@ #define TPM_PASSTHROUGH(obj) \ OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH) =20 -static const TPMDriverOps tpm_passthrough_driver; - /* data structures */ typedef struct TPMPassthruThreadParams { TPMState *tpm_state; @@ -462,8 +460,6 @@ static TPMBackend *tpm_passthrough_create(QemuOpts *o= pts, const char *id) /* let frontend set the fe_model to proper value */ tb->fe_model =3D -1; =20 - tb->ops =3D &tpm_passthrough_driver; - if (tpm_passthrough_handle_device_opts(opts, tb)) { goto err_exit; } diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index b0a9731..3708413 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -50,7 +50,6 @@ struct TPMBackend { enum TpmModel fe_model; char *path; char *cancel_path; - const TPMDriverOps *ops; =20 QLIST_ENTRY(TPMBackend) list; }; diff --git a/tpm.c b/tpm.c index 2d830d0..abedf3f 100644 --- a/tpm.c +++ b/tpm.c @@ -211,7 +211,7 @@ static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv) res->model =3D drv->fe_model; res->options =3D g_new0(TpmTypeOptions, 1); =20 - switch (drv->ops->type) { + switch (tpm_backend_get_type(drv)) { case TPM_TYPE_PASSTHROUGH: res->options->type =3D TPM_TYPE_OPTIONS_KIND_PASSTHROUGH; tpo =3D g_new0(TPMPassthroughOptions, 1); --=20 2.5.5