From patchwork Tue Dec 15 11:26:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 41180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0A1EAB7BBB for ; Tue, 15 Dec 2009 22:39:23 +1100 (EST) Received: from localhost ([127.0.0.1]:54850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKVkN-00058O-HH for incoming@patchwork.ozlabs.org; Tue, 15 Dec 2009 06:39:19 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKVY1-00018q-Tr for qemu-devel@nongnu.org; Tue, 15 Dec 2009 06:26:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKVXt-00012n-5V for qemu-devel@nongnu.org; Tue, 15 Dec 2009 06:26:29 -0500 Received: from [199.232.76.173] (port=43798 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKVXs-00012G-8o for qemu-devel@nongnu.org; Tue, 15 Dec 2009 06:26:24 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:42998) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKVXq-000585-Aa for qemu-devel@nongnu.org; Tue, 15 Dec 2009 06:26:24 -0500 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 53D89106A29; Tue, 15 Dec 2009 20:26:15 +0900 (JST) Received: (nullmailer pid 28245 invoked by uid 1000); Tue, 15 Dec 2009 11:26:07 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, mst@redhat.com Date: Tue, 15 Dec 2009 20:26:06 +0900 Message-Id: <1260876367-28197-10-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1260876367-28197-1-git-send-email-yamahata@valinux.co.jp> References: <1260876367-28197-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH V2 09/10] piix_pci: use range helper function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)