From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7olo-0001je-Qn for qemu-devel@nongnu.org; Sun, 25 Sep 2011 09:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7oln-0004oY-K1 for qemu-devel@nongnu.org; Sun, 25 Sep 2011 09:29:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7oln-0004oR-8A for qemu-devel@nongnu.org; Sun, 25 Sep 2011 09:29:23 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8PDTLuu015273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 25 Sep 2011 09:29:21 -0400 Date: Sun, 25 Sep 2011 16:30:31 +0300 From: "Michael S. Tsirkin" Message-ID: <20110925133030.GA32070@redhat.com> References: <1316956977-30466-1-git-send-email-avi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1316956977-30466-1-git-send-email-avi@redhat.com> Subject: Re: [Qemu-devel] [PATCH] pci: simplify memory region registration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org On Sun, Sep 25, 2011 at 04:22:57PM +0300, Avi Kivity wrote: > The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are > identical. Unify them. > > Signed-off-by: Avi Kivity Applied, thanks > --- > 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); > } > } > } > -- > 1.7.6.3