aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2019-05-10 15:56:20 -0300
committerDr. David Alan Gilbert <dgilbert@redhat.com>2019-05-14 19:00:04 +0100
commit9d3250d5ba8c4c5389530b861686e22e77fddcc7 (patch)
tree80b616d06242e232762600f80b2d7745ea5015e2
parenta5f7b1a63ced35cc18fe8fa9e1679219fad9abde (diff)
downloadqemu-9d3250d5ba8c4c5389530b861686e22e77fddcc7.zip
qemu-9d3250d5ba8c4c5389530b861686e22e77fddcc7.tar.gz
qemu-9d3250d5ba8c4c5389530b861686e22e77fddcc7.tar.bz2
monitor: Call mon_get_cpu() only once at hmp_gva2gpa()
hmp_gva2gpa() calls mon_get_cpu() twice, which is unnecessary. Not an actual bug, but this is reported as a defect by Coverity Scan (CID 1401346). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190510185620.15757-1-ehabkost@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
-rw-r--r--monitor.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index bb48997..6428eb3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1685,8 +1685,7 @@ static void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
return;
}
- gpa = cpu_get_phys_page_attrs_debug(mon_get_cpu(),
- addr & TARGET_PAGE_MASK, &attrs);
+ gpa = cpu_get_phys_page_attrs_debug(cs, addr & TARGET_PAGE_MASK, &attrs);
if (gpa == -1) {
monitor_printf(mon, "Unmapped\n");
} else {