From f92da573c571159aeb575a3eb248c13b635bf9a6 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sat, 31 Jul 2010 23:05:01 +0300 Subject: [PATCH] kvm, pci: Don't calculate offset twice Signed-off-by: Pekka Enberg --- tools/kvm/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/pci.c b/tools/kvm/pci.c index 0ac0ae5f374f..0558b2ccd43d 100644 --- a/tools/kvm/pci.c +++ b/tools/kvm/pci.c @@ -63,7 +63,7 @@ static bool pci_config_data_in(struct kvm *self, uint16_t port, void *data, int if (offset < sizeof(struct pci_device_header)) { void *p = &virtio_device; - memcpy(data, p + (pci_config_address.register_number << 2), size); + memcpy(data, p + offset, size); } else memset(data, 0x00, size); } else -- 2.39.5