diff options
author | Markus Armbruster <armbru@redhat.com> | 2022-11-04 17:07:07 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2022-12-14 20:05:07 +0100 |
commit | ced2939685bb306431c2ffb1620460dfb6093a1a (patch) | |
tree | 6552f7bbc01cd0ed88e77e276bff4bb4ba8847b0 /monitor | |
parent | 1dde96d65fcfd44b4097cdbbad21d2e40167aa1c (diff) |
qapi tpm: Elide redundant has_FOO in generated C
The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with. Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step. This is the step for qapi/tpm.json.
Said commit explains the transformation in more detail. The invariant
violations mentioned there do not occur here.
Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Message-Id: <20221104160712.3005652-26-armbru@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/hmp-cmds.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index a41f94a34a..3ada344d77 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -864,10 +864,10 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict) case TPM_TYPE_PASSTHROUGH: tpo = ti->options->u.passthrough.data; monitor_printf(mon, "%s%s%s%s", - tpo->has_path ? ",path=" : "", - tpo->has_path ? tpo->path : "", - tpo->has_cancel_path ? ",cancel-path=" : "", - tpo->has_cancel_path ? tpo->cancel_path : ""); + tpo->path ? ",path=" : "", + tpo->path ?: "", + tpo->cancel_path ? ",cancel-path=" : "", + tpo->cancel_path ?: ""); break; case TPM_TYPE_EMULATOR: teo = ti->options->u.emulator.data; |