block/sheepdog: remove spurious NULL check
authorJeff Cody <jcody@redhat.com>
Tue, 7 Nov 2017 22:27:20 +0000 (17:27 -0500)
committerJeff Cody <jcody@redhat.com>
Mon, 18 Dec 2017 20:41:17 +0000 (15:41 -0500)
'tag' is already checked in the lines immediately preceding this check,
and set to non-NULL if NULL.  No need to check again, it hasn't changed.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/sheepdog.c

index 696a71442a31217e60d3cb41260227e497d6442c..459d93a35f75f4c16bd392e6bc20f4f06b4d77d0 100644 (file)
@@ -1632,7 +1632,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
     if (!tag) {
         tag = "";
     }
-    if (tag && strlen(tag) >= SD_MAX_VDI_TAG_LEN) {
+    if (strlen(tag) >= SD_MAX_VDI_TAG_LEN) {
         error_setg(errp, "value of parameter 'tag' is too long");
         ret = -EINVAL;
         goto err_no_fd;