From patchwork Sun Sep 25 13:22:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 116294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0A84B6F72 for ; Sun, 25 Sep 2011 23:23:23 +1000 (EST) Received: from localhost ([::1]:42878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7ofw-00087I-VF for incoming@patchwork.ozlabs.org; Sun, 25 Sep 2011 09:23:20 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7ofq-0007yf-5N for qemu-devel@nongnu.org; Sun, 25 Sep 2011 09:23:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7ofo-0003tg-S4 for qemu-devel@nongnu.org; Sun, 25 Sep 2011 09:23:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7ofo-0003tc-FZ for qemu-devel@nongnu.org; Sun, 25 Sep 2011 09:23:12 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8PDNBqt027681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 25 Sep 2011 09:23:11 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p8PDNAeG002951 for ; Sun, 25 Sep 2011 09:23:11 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 5A65C250B5E; Sun, 25 Sep 2011 16:23:05 +0300 (IDT) From: Avi Kivity To: "Michael S. Tsirkin" Date: Sun, 25 Sep 2011 16:22:57 +0300 Message-Id: <1316956977-30466-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] pci: simplify memory region registration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are identical. Unify them. Signed-off-by: Avi Kivity --- hw/pci.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 749e8d8..e8cc1b0 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -998,17 +998,8 @@ static void pci_update_mappings(PCIDevice *d) } r->addr = new_addr; if (r->addr != PCI_BAR_UNMAPPED) { - if (r->type & PCI_BASE_ADDRESS_SPACE_IO) { - memory_region_add_subregion_overlap(r->address_space, - r->addr, - r->memory, - 1); - } else { - memory_region_add_subregion_overlap(r->address_space, - r->addr, - r->memory, - 1); - } + memory_region_add_subregion_overlap(r->address_space, + r->addr, r->memory, 1); } } }