From: Jonathon Jongsma Date: Wed, 21 Apr 2021 15:47:43 +0000 (-0500) Subject: nodedev: remove unnecessary checks for NULL cmd X-Git-Tag: v7.3.0-rc1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68580a51;p=thirdparty%2Flibvirt.git nodedev: remove unnecessary checks for NULL cmd 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 Reviewed-by: Michal Privoznik --- 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)