habanalabs: eliminate redundant else condition
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 12 Aug 2020 07:19:28 +0000 (10:19 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 22 Sep 2020 15:49:50 +0000 (18:49 +0300)
If both parts of if-else are goto statements, we can remove the else and
put the else goto statement after the if statement.

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/common/command_submission.c

index 00c1ff2e953da9b1be97a666dd220d890377890f..a811a9fdf13b735965f5eb897664baffefcd5e9c 100644 (file)
@@ -686,8 +686,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
                        rc = -ENOMEM;
                        if (is_kernel_allocated_cb)
                                goto release_cb;
-                       else
-                               goto free_cs_object;
+
+                       goto free_cs_object;
                }
 
                job->id = i + 1;