From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mn7m0-0001TD-6P for qemu-devel@nongnu.org; Mon, 14 Sep 2009 05:23:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mn7lv-0001Hr-6F for qemu-devel@nongnu.org; Mon, 14 Sep 2009 05:22:59 -0400 Received: from [199.232.76.173] (port=54840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn7lu-0001HW-Vp for qemu-devel@nongnu.org; Mon, 14 Sep 2009 05:22:55 -0400 Received: from miranda.se.axis.com ([193.13.178.8]:59270) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mn7lu-00086i-Hp for qemu-devel@nongnu.org; Mon, 14 Sep 2009 05:22:54 -0400 Date: Mon, 14 Sep 2009 11:15:45 +0200 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [PATCH 1/6] Move function definitions out of xilinx.h Message-ID: <20090914091545.GA21160@edde.se.axis.com> References: <37d5a3ce941bc89f6d73b8e7bf746952a0074da2.1252699478.git.armbru@redhat.com> <20090912101009.GC16110@laped.iglesias.mooo.com> <4AAE0575.8060607@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AAE0575.8060607@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Blue Swirl , Paul Brook , qemu-devel@nongnu.org, Markus Armbruster On Mon, Sep 14, 2009 at 10:57:25AM +0200, Gerd Hoffmann wrote: > On 09/12/09 12:10, Edgar E. Iglesias wrote: >> On Sat, Sep 12, 2009 at 09:04:17AM +0300, Blue Swirl wrote: >>> On Fri, Sep 11, 2009 at 11:19 PM, Markus Armbruster >>> wrote: >>>> xilinx.h defines a couple of static inline functions for creating >>>> devices. While that's a fair technique for hot functions, device >>>> initialization is about as cold as it gets. Define them in the device >>>> source files instead, and keep only declarations in the header. >>> >>> If I understood the qdev plan correctly, this is going to wrong >>> direction. These functions should reside near the instantiation, not >>> in the device code. The current approach looks OK if there are going >>> to be more users of the devices. > > The functions should go away ;) > > Some day the information carried by those code snippeds should come from a > machine description file, then we'll don't need them any more. I agree. > >> I agree that they shouldn't be in the device source. >> The reason they ended up in a header and not with the petalogix board >> was that in my tree there are multiple boards using these functions >> to easy instantiate devices. > > They have to be somewhere. Having them in a header file is unclean. Having > them in the board-specific code isn't practical when multiple boards share > the code. I'd stick them to the device source code as well. Also note > that this is common practice elsewhere in the tree. I disagree. But if ppl feel very strongly about this, I can remove them and deal with the code duplication in my tree. Afterall, it's unlikely that upsteam qemu gets more xilinx boards before some kind of device tree driven board support is there. Cheers