From: Sasha Levin Date: Fri, 12 Aug 2011 07:37:23 +0000 (+0300) Subject: kvm tools: Missing braces in BAR index calculation X-Git-Tag: next-20110824~3^2~34 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=60ac272cb977c775ef6d17e8a012578bb2b0a31b;p=karo-tx-linux.git kvm tools: Missing braces in BAR index calculation This patch adds missing braces which were forgotten in 42dfae5 ("kvm tools: Use correct size for VESA memory bar"). Reported-by: David Evensky Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/pci.c b/tools/kvm/pci.c index 0449acafc964..523c4c7774de 100644 --- a/tools/kvm/pci.c +++ b/tools/kvm/pci.c @@ -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])