Re: [PATCH v2 1/3] virDomainDeviceInfoParseXML: Separate address parsing into separate func

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

 



On Tue, Oct 03, 2017 at 12:58:57PM +0200, Michal Privoznik wrote:
There's one 'return' in the middle of the function body. It's
very easy to miss and so it makes adding new code harder. Also
the function doesn't follow our style 100%.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/conf/domain_conf.c | 174 ++++++++++++++++++++++++++-----------------------
1 file changed, 93 insertions(+), 81 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 87192eb2d..0bc2e2f94 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6364,102 +6452,26 @@ virDomainDeviceInfoParseXML(xmlNodePtr node,
    }

    if (rom) {
-        char *rombar = virXMLPropString(rom, "bar");
-        if (rombar &&
+        if ((rombar = virXMLPropString(rom, "bar")) &&

If this is what you meant by "follow our coding style 100%", then I
think you are wrong since this (IMHO bad) style is not explicitly
mentioned, only (mis)used once.  But I'm not fighting over it since I
know more people prefer less readable code that saves one or two lines =)

ACK

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux