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

2021-04-21 Thread Michal Privoznik

On 4/21/21 5:52 PM, Jonathon Jongsma wrote:

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 
---
  src/node_device/node_device_driver.c | 6 --
  1 file changed, 6 deletions(-)



Reviewed-by: Michal Privoznik 

Michal



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

2021-04-21 Thread Jonathon Jongsma
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 
---
 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, ) < 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, ) < 0 || status != 0)
-- 
2.26.3