From: Sasha Levin Subject: [PATCH] kvm tools: Missing braces in BAR index calculation Date: Fri, 12 Aug 2011 10:37:23 +0300 Message-ID: <1313134643-4045-1-git-send-email-levinsasha928@gmail.com> Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, Sasha Levin To: penberg@kernel.org Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:51647 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259Ab1HLHie (ORCPT ); Fri, 12 Aug 2011 03:38:34 -0400 Received: by wyg24 with SMTP id 24so1921570wyg.19 for ; Fri, 12 Aug 2011 00:38:33 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: 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 --- tools/kvm/pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/pci.c b/tools/kvm/pci.c index 0449aca..523c4c7 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]) -- 1.7.6