From patchwork Tue Dec 15 11:26:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V2,09/10] piix_pci: use range helper function Date: Tue, 15 Dec 2009 01:26:06 -0000 From: Isaku Yamahata X-Patchwork-Id: 41180 Message-Id: <1260876367-28197-10-git-send-email-yamahata@valinux.co.jp> To: qemu-devel@nongnu.org, mst@redhat.com Cc: yamahata@valinux.co.jp use range helper function in i440fx_write_config(). Signed-off-by: Isaku Yamahata --- hw/piix_pci.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index 0dae6f9..384d31c 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -137,10 +137,10 @@ static void i440fx_write_config(PCIDevice *dev, /* XXX: implement SMRAM.D_LOCK */ pci_default_write_config(dev, address, val, len); - if ((address >= I440FX_PAM && - address <= I440FX_PAM + I440FX_PAM_SIZE - 1) || - address == I440FX_SMRAM) + if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) || + range_covers_byte(address, len, I440FX_SMRAM)) { i440fx_update_memory_mappings(d); + } } static int i440fx_load_old(QEMUFile* f, void *opaque, int version_id)