Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQe2f-00017X-8u for qemu-devel@nongnu.org; Tue, 14 Jul 2009 05:11:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQe2a-00015O-Fn for qemu-devel@nongnu.org; Tue, 14 Jul 2009 05:11:16 -0400 Received: from [199.232.76.173] (port=52703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQe2Z-00015L-Tj for qemu-devel@nongnu.org; Tue, 14 Jul 2009 05:11:11 -0400 Received: from mx2.redhat.com ([66.187.237.31]:55125) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQe2Z-0000tN-DR for qemu-devel@nongnu.org; Tue, 14 Jul 2009 05:11:11 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6E9BAED031513 for ; Tue, 14 Jul 2009 05:11:10 -0400 From: Juan Quintela In-Reply-To: <4A5C251A.6050309@redhat.com> (Gerd Hoffmann's message of "Tue\, 14 Jul 2009 08\:26\:34 +0200") References: <1247499005-31011-1-git-send-email-kraxel@redhat.com> <1247499005-31011-3-git-send-email-kraxel@redhat.com> <20090713193652.GA10979@redhat.com> <4A5C251A.6050309@redhat.com> Date: Tue, 14 Jul 2009 11:09:29 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 2/6] qdev/compat: compat property infrastructure. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" Gerd Hoffmann wrote: > On 07/13/09 21:36, Michael S. Tsirkin wrote: >> Some coding style comments >>> + return; >>> + for (prop = compat_props; prop->driver != NULL; prop++) { >> >> != NULL not needed in if >> >>> + if (strcmp(dev->info->name, prop->driver) != 0) >> >> != 0 not needed in if > > I still prefer to have it explicitly written as it makes the code more > readable IMHO. > >>> void qdev_prop_set_defaults(DeviceState *dev, Property *props); >>> >>> +void qdev_register_compat_props(CompatProperty *props); >> >> qedev_set_compat_props might be a better name. >> >>> +void qdev_prop_set_compat(DeviceState *dev); >> >> qdev_parse_compat_props might be a better name. > > Disagree on both. qdev_prop_set_compat intentionally follows the name > convention of the other qdev_prop_set_* functions. The > qdev_register_compat_props intentionally isn't named something with > "set" to avoid confusion with the other ones because it doesn't > actually set properties on devices. "register" maybe isn't the best > idea, I'm open to better suggestions. I didn't liked either. I would prefer to also use qdev_prop_ preffix as the other functions that deal with properties. +void qdev_prop_register_compat(CompatProperty *props); ??? (I didn't get any good name with [qdev,prop,compat] in it. Later, Juan. > Fixed the other ones. > > cheers, > Gerd