pci: Rename hmp_pcie_aer_inject_error()'s local variable @err

I'd like to use @err for an Error *err.  Rename PCIEAERErr err to
aer_err.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221201121133.3813857-12-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2022-12-01 13:11:31 +01:00
parent 74a11ca6d9
commit c276dc8930

View File

@ -167,7 +167,7 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
unsigned int num; unsigned int num;
bool correctable; bool correctable;
PCIDevice *dev; PCIDevice *dev;
PCIEAERErr err; PCIEAERErr aer_err;
int ret; int ret;
ret = pci_qdev_find_device(id, &dev); ret = pci_qdev_find_device(id, &dev);
@ -193,34 +193,34 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
error_status = num; error_status = num;
correctable = qdict_get_try_bool(qdict, "correctable", false); correctable = qdict_get_try_bool(qdict, "correctable", false);
} }
err.status = error_status; aer_err.status = error_status;
err.source_id = pci_requester_id(dev); aer_err.source_id = pci_requester_id(dev);
err.flags = 0; aer_err.flags = 0;
if (correctable) { if (correctable) {
err.flags |= PCIE_AER_ERR_IS_CORRECTABLE; aer_err.flags |= PCIE_AER_ERR_IS_CORRECTABLE;
} }
if (qdict_get_try_bool(qdict, "advisory_non_fatal", false)) { if (qdict_get_try_bool(qdict, "advisory_non_fatal", false)) {
err.flags |= PCIE_AER_ERR_MAYBE_ADVISORY; aer_err.flags |= PCIE_AER_ERR_MAYBE_ADVISORY;
} }
if (qdict_haskey(qdict, "header0")) { if (qdict_haskey(qdict, "header0")) {
err.flags |= PCIE_AER_ERR_HEADER_VALID; aer_err.flags |= PCIE_AER_ERR_HEADER_VALID;
} }
if (qdict_haskey(qdict, "prefix0")) { if (qdict_haskey(qdict, "prefix0")) {
err.flags |= PCIE_AER_ERR_TLP_PREFIX_PRESENT; aer_err.flags |= PCIE_AER_ERR_TLP_PREFIX_PRESENT;
} }
err.header[0] = qdict_get_try_int(qdict, "header0", 0); aer_err.header[0] = qdict_get_try_int(qdict, "header0", 0);
err.header[1] = qdict_get_try_int(qdict, "header1", 0); aer_err.header[1] = qdict_get_try_int(qdict, "header1", 0);
err.header[2] = qdict_get_try_int(qdict, "header2", 0); aer_err.header[2] = qdict_get_try_int(qdict, "header2", 0);
err.header[3] = qdict_get_try_int(qdict, "header3", 0); aer_err.header[3] = qdict_get_try_int(qdict, "header3", 0);
err.prefix[0] = qdict_get_try_int(qdict, "prefix0", 0); aer_err.prefix[0] = qdict_get_try_int(qdict, "prefix0", 0);
err.prefix[1] = qdict_get_try_int(qdict, "prefix1", 0); aer_err.prefix[1] = qdict_get_try_int(qdict, "prefix1", 0);
err.prefix[2] = qdict_get_try_int(qdict, "prefix2", 0); aer_err.prefix[2] = qdict_get_try_int(qdict, "prefix2", 0);
err.prefix[3] = qdict_get_try_int(qdict, "prefix3", 0); aer_err.prefix[3] = qdict_get_try_int(qdict, "prefix3", 0);
ret = pcie_aer_inject_error(dev, &err); ret = pcie_aer_inject_error(dev, &aer_err);
if (ret < 0) { if (ret < 0) {
monitor_printf(mon, "failed to inject error: %s\n", monitor_printf(mon, "failed to inject error: %s\n",
strerror(-ret)); strerror(-ret));