Received: from eggs.gnu.org ([2001:4830:134:3::10]:51260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0TZD-0002Il-00 for qemu-devel@nongnu.org; Tue, 18 Apr 2017 09:53:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0TZ8-0005yf-V1 for qemu-devel@nongnu.org; Tue, 18 Apr 2017 09:53:15 -0400 Date: Tue, 18 Apr 2017 10:53:03 -0300 From: Eduardo Habkost Message-ID: <20170418135303.GM25239@thinpad.lan.raisama.net> References: <20170417215916.12431-1-ehabkost@redhat.com> <20170417215916.12431-6-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC 5/7] pci: Set phb->bus inside pci_register_bus() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org, aik@ozlabs.ru, David Gibson , "Michael S. Tsirkin" , Laszlo Ersek , Richard Henderson , Aurelien Jarno , Yongbok Kim , Alexander Graf , Scott Wood , Paul Burton , David Gibson , Cornelia Huck , Christian Borntraeger , qemu-ppc@nongnu.org On Tue, Apr 18, 2017 at 04:43:48PM +0300, Marcel Apfelbaum wrote: > On 04/18/2017 12:59 AM, Eduardo Habkost wrote: > > Every single caller of of pci_register_bus() saves the return value in > > phb->bus. Do that inside pci_register_bus() to avoid code duplication > > and make it harder to break. > > > > I personally find that more difficult to follow, maybe the function > name is misleading. > Maybe we can find a better function name or explain the side effect > in a comment? I agree we need better function names (for both pci_register_bus() and pci_bus_new*()). But I am not experienced enough with the PCI code to find a good name. Any suggestions? -- Eduardo