tools:iio: return values directly
Return directly, if no common cleanup is required.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index cf9a412..62ec398 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -238,8 +238,7 @@
dev_num = find_type_by_name(device_name, "iio:device");
if (dev_num < 0) {
printf("Failed to find the %s\n", device_name);
- ret = dev_num;
- goto error_ret;
+ return dev_num;
}
printf("iio device number being used is %d\n", dev_num);
@@ -410,6 +409,6 @@
free(trigger_name);
error_free_dev_dir_name:
free(dev_dir_name);
-error_ret:
+
return ret;
}