diff mbox series

[30/42] tpm-passthrough: pass TPMPassthruState to handle_device_opts

Message ID 20171009225623.29232-31-marcandre.lureau@redhat.com
State New
Headers show
Series TPM: code cleanup & CRB device | expand

Commit Message

Marc-André Lureau Oct. 9, 2017, 10:56 p.m. UTC
It doesn't need TPMBackend. Also reorder arguments for consistency.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/tpm/tpm_passthrough.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefan Berger Oct. 10, 2017, 8:29 p.m. UTC | #1
On 10/09/2017 06:56 PM, Marc-André Lureau wrote:
> It doesn't need TPMBackend. Also reorder arguments for consistency.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

> ---
>   hw/tpm/tpm_passthrough.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
> index 048edb1a1a..9326cbfdc9 100644
> --- a/hw/tpm/tpm_passthrough.c
> +++ b/hw/tpm/tpm_passthrough.c
> @@ -239,9 +239,9 @@ static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)
>       return fd;
>   }
>
> -static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
> +static int
> +tpm_passthrough_handle_device_opts(TPMPassthruState *tpm_pt, QemuOpts *opts)
>   {
> -    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
>       const char *value;
>
>       value = qemu_opt_get(opts, "cancel-path");
> @@ -292,7 +292,7 @@ static TPMBackend *tpm_passthrough_create(QemuOpts *opts, const char *id)
>
>       tb->id = g_strdup(id);
>
> -    if (tpm_passthrough_handle_device_opts(opts, tb)) {
> +    if (tpm_passthrough_handle_device_opts(tpm_pt, opts)) {
>           goto err_exit;
>       }
>
diff mbox series

Patch

diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 048edb1a1a..9326cbfdc9 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -239,9 +239,9 @@  static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)
     return fd;
 }
 
-static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
+static int
+tpm_passthrough_handle_device_opts(TPMPassthruState *tpm_pt, QemuOpts *opts)
 {
-    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
     const char *value;
 
     value = qemu_opt_get(opts, "cancel-path");
@@ -292,7 +292,7 @@  static TPMBackend *tpm_passthrough_create(QemuOpts *opts, const char *id)
 
     tb->id = g_strdup(id);
 
-    if (tpm_passthrough_handle_device_opts(opts, tb)) {
+    if (tpm_passthrough_handle_device_opts(tpm_pt, opts)) {
         goto err_exit;
     }