From patchwork Wed Mar 14 00:48:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 146509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 38CFAB6F62 for ; Wed, 14 Mar 2012 11:48:54 +1100 (EST) Received: from localhost ([::1]:51535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7cOZ-0000Do-J5 for incoming@patchwork.ozlabs.org; Tue, 13 Mar 2012 20:48:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7cOS-0000DA-QM for qemu-devel@nongnu.org; Tue, 13 Mar 2012 20:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7cOR-0007IJ-2q for qemu-devel@nongnu.org; Tue, 13 Mar 2012 20:48:44 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:58973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7cOQ-0007IA-Uv for qemu-devel@nongnu.org; Tue, 13 Mar 2012 20:48:43 -0400 Received: by vcbfl11 with SMTP id fl11so1589328vcb.4 for ; Tue, 13 Mar 2012 17:48:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=HpJGePtVTUguvsW+n5GORB3O5B1EEkh6e6A1NUb1kFU=; b=K19Vm2iuR7rURZ4iesaO4lfDQO9o5sokGl0kCkFLBeAE2PCOTTsUnkn5gGRBpJpviY EuPZNuoj229UdgFRX8S+7PfEDhQct5EJt45ANZ/OdwBJ+zC/Dz7nkjhvW57TaJZGYYtl AmcbJCjBQyC+vAgoroK2wJgU1jJA5z724vrIRcNvtJeGDvKVweFHf9VVR2k9Jlj2zhbj num4aAGityOnl6L6lHM6z6pHFOR83QA4jRHHeaFn5bESE3A2zm2IJ3gNNNMFnnvj2F4q KRW7EczJgWZ9kvpeE+KMmSUEjW3Wf8VOg8FbRAoVtkH1kJkL9qVvjy7Tsdp8NgRuj4/R xZyg== Received: by 10.52.70.175 with SMTP id n15mr499994vdu.10.1331686119964; Tue, 13 Mar 2012 17:48:39 -0700 (PDT) Received: from localhost (207-172-165-101.c3-0.avec-ubr1.nyr-avec.ny.cable.rcn.com. [207.172.165.101]) by mx.google.com with ESMTPS id ei6sm2806318vdc.6.2012.03.13.17.48.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Mar 2012 17:48:39 -0700 (PDT) Date: Tue, 13 Mar 2012 20:48:37 -0400 From: Kevin O'Connor To: Alexey Korolev Message-ID: <20120314004837.GB2252@morn.localdomain> References: <1331613556.26071.43.camel@nzhmlwks0057.ad.endace.com> <1331613919.26071.49.camel@nzhmlwks0057.ad.endace.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1331613919.26071.49.camel@nzhmlwks0057.ad.endace.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnwmwEGF3RjhH8WefqQvhP/QXtHMmiSYbCs+0jk47uo3/4XGRzZjTR9SULIEBzSRnZHIdOR X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.173 Cc: sfd@endace.com, seabios@seabios.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH 2/6] Redesign of pciinit.c (take 2) 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 On Tue, Mar 13, 2012 at 05:45:19PM +1300, Alexey Korolev wrote: > Added pci_region_entry structure and list operations to pciinit.c > List is filled with entries during pci_check_devices. > List is used just for printing space allocation if we were using lists. > Next step will resource allocation using mapping functions. [...] > +struct pci_bus; > +struct pci_region_entry { > + struct pci_device *dev; > + int bar; > + u32 base; > + u32 size; > + int is64bit; > + enum pci_region_type type; > + struct pci_bus *this_bus; > + struct pci_bus *parent_bus; > + struct pci_region_entry *next; > + struct pci_region_entry **pprev; > +}; It's fine to introduce a new struct, but a patch that does this should have something like the following in the same patch: And it should compile and work fine after applying just that one patch. That is, you're not introducing a new struct, you're moving the contents from one struct to another. The code is being changed - it's not new code being added and old code being deleted - the patches need to reflect that. (If it's a pain to move the struct out of struct pci_device at the start, then add your new fields into struct pci_device.bars and use a patch to move the whole thing out of pci.h at the end.) -Kevin --- a/src/pci.h +++ b/src/pci.h @@ -51,11 +51,6 @@ struct pci_device { u8 prog_if, revision; u8 header_type; u8 secondary_bus; - struct { - u32 addr; - u32 size; - int is64; - } bars[PCI_NUM_REGIONS]; // Local information on device. int have_driver;