[libvirt PATCH v2 3/3] nodedev: remove unnecessary checks for NULL cmd

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

 



virCommandRun() already handles the case where the cmd argument is NULL,
so there's no need for the caller to check. Make all callers consistent
and remove unnecessary NULL checks.

Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
 src/node_device/node_device_driver.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 49f3cc166d..8a0a2c3847 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -799,9 +799,6 @@ virMdevctlCreate(virNodeDeviceDef *def, char **uuid, char **errmsg)
                                                             MDEVCTL_CMD_CREATE,
                                                             uuid,
                                                             errmsg);
-    if (!cmd)
-        return -1;
-
     /* an auto-generated uuid is returned via stdout if no uuid is specified in
      * the mdevctl args */
     if (virCommandRun(cmd, &status) < 0 || status != 0)
@@ -822,9 +819,6 @@ virMdevctlDefine(virNodeDeviceDef *def, char **uuid, char **errmsg)
                                                             MDEVCTL_CMD_DEFINE,
                                                             uuid, errmsg);
 
-    if (!cmd)
-        return -1;
-
     /* an auto-generated uuid is returned via stdout if no uuid is specified in
      * the mdevctl args */
     if (virCommandRun(cmd, &status) < 0 || status != 0)
-- 
2.26.3




[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