aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-9p-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/virtio-9p-test.c')
-rw-r--r--tests/virtio-9p-test.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
index 693920af5f..9c4f6cb406 100644
--- a/tests/virtio-9p-test.c
+++ b/tests/virtio-9p-test.c
@@ -95,7 +95,6 @@ static void qvirtio_9p_pci_free(QVirtIO9P *v9p)
static void pci_basic_config(void)
{
QVirtIO9P *v9p;
- void *addr;
size_t tag_len;
char *tag;
int i;
@@ -104,15 +103,12 @@ static void pci_basic_config(void)
qs = qvirtio_9p_start();
v9p = qvirtio_9p_pci_init(qs);
- addr = ((QVirtioPCIDevice *) v9p->dev)->addr + VIRTIO_PCI_CONFIG_OFF(false);
- tag_len = qvirtio_config_readw(v9p->dev,
- (uint64_t)(uintptr_t)addr);
+ tag_len = qvirtio_config_readw(v9p->dev, 0);
g_assert_cmpint(tag_len, ==, strlen(mount_tag));
- addr += sizeof(uint16_t);
tag = g_malloc(tag_len);
for (i = 0; i < tag_len; i++) {
- tag[i] = qvirtio_config_readb(v9p->dev, (uint64_t)(uintptr_t)addr + i);
+ tag[i] = qvirtio_config_readb(v9p->dev, i + 2);
}
g_assert_cmpmem(tag, tag_len, mount_tag, tag_len);
g_free(tag);