[PATCH 03/11] node_device: remove unnecessary checks in virNodeDeviceDefFormat

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

 



virBufferEscapeString already contains the null check.

Signed-off-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
---
 src/conf/node_device_conf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 68924b3027..9a0fc68e67 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -669,16 +669,14 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def)
     virBufferAdjustIndent(&buf, 2);
     virBufferEscapeString(&buf, "<name>%s</name>\n", def->name);
     virBufferEscapeString(&buf, "<path>%s</path>\n", def->sysfs_path);
-    if (def->devnode)
-        virBufferEscapeString(&buf, "<devnode type='dev'>%s</devnode>\n",
-                              def->devnode);
+    virBufferEscapeString(&buf, "<devnode type='dev'>%s</devnode>\n",
+                          def->devnode);
     if (def->devlinks) {
         for (i = 0; def->devlinks[i]; i++)
             virBufferEscapeString(&buf, "<devnode type='link'>%s</devnode>\n",
                                   def->devlinks[i]);
     }
-    if (def->parent)
-        virBufferEscapeString(&buf, "<parent>%s</parent>\n", def->parent);
+    virBufferEscapeString(&buf, "<parent>%s</parent>\n", def->parent);
     if (def->driver) {
         virBufferAddLit(&buf, "<driver>\n");
         virBufferAdjustIndent(&buf, 2);
-- 
2.42.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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