qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/6] qdev/compat: compat property infrastructure


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 2/6] qdev/compat: compat property infrastructure.
Date: Tue, 14 Jul 2009 08:26:34 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

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.

Fixed the other ones.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]