]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Missing braces in BAR index calculation
authorSasha Levin <levinsasha928@gmail.com>
Fri, 12 Aug 2011 07:37:23 +0000 (10:37 +0300)
committerPekka Enberg <penberg@kernel.org>
Fri, 12 Aug 2011 08:04:37 +0000 (11:04 +0300)
This patch adds missing braces which were forgotten in 42dfae5
("kvm tools: Use correct size for VESA memory bar").

Reported-by: David Evensky <evensky@dancer.ca.sandia.gov>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/pci.c

index 0449acafc964a9f07b627898370f8906d08a5784..523c4c7774dece339bf4e45d703802ffa0028ca8 100644 (file)
@@ -95,7 +95,7 @@ static bool pci_config_data_out(struct ioport *ioport, struct kvm *kvm, u16 port
                offset = start + (pci_config_address.register_number << 2);
                if (offset < sizeof(struct pci_device_header)) {
                        void *p = pci_devices[dev_num];
-                       u8 bar = offset - PCI_BAR_OFFSET(0) / (sizeof(u32));
+                       u8 bar = (offset - PCI_BAR_OFFSET(0)) / (sizeof(u32));
                        u32 sz = PCI_IO_SIZE;
 
                        if (bar < 6 && pci_devices[dev_num]->bar_size[bar])