diff options
author | Thomas Huth <thuth@redhat.com> | 2016-10-12 17:33:44 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2016-10-28 18:17:23 +0300 |
commit | 5f333d79a4337b390fa4103e270d2bdaf243aad6 (patch) | |
tree | 6d7cdb75a4afb6c4e31910213f21a0e04ca93785 /hw/tpm | |
parent | c551cd52cc4424b98548132d6a49baddeae6ee80 (diff) |
hw/tpm/tpm_passthrough: Simplify if-statements a little bit
The condition '!A || (A && B)' is equivalent to '!A || B'
Buglink: https://bugs.launchpad.net/qemu/+bug/1464611
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/tpm')
-rw-r--r-- | hw/tpm/tpm_passthrough.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index e88c0d20bc..9234eb3459 100644 --- a/hw/tpm/tpm_passthrough.c +++ b/hw/tpm/tpm_passthrough.c @@ -165,8 +165,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt, ret = tpm_passthrough_unix_write(tpm_pt->tpm_fd, in, in_len); if (ret != in_len) { - if (!tpm_pt->tpm_op_canceled || - (tpm_pt->tpm_op_canceled && errno != ECANCELED)) { + if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) { error_report("tpm_passthrough: error while transmitting data " "to TPM: %s (%i)", strerror(errno), errno); @@ -178,8 +177,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt, ret = tpm_passthrough_unix_read(tpm_pt->tpm_fd, out, out_len); if (ret < 0) { - if (!tpm_pt->tpm_op_canceled || - (tpm_pt->tpm_op_canceled && errno != ECANCELED)) { + if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) { error_report("tpm_passthrough: error while reading data from " "TPM: %s (%i)", strerror(errno), errno); |