Clean-up: get_field_type should only have one return statement
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 25 May 2015 20:09:27 +0000 (16:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 25 May 2015 20:09:27 +0000 (16:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/trace.c

index 32de5bb5f0d74929faffe4c68b05e0cabe84ec40..158f2b8bbc2e6d13ea8555ecb95a8cff0011d306 100644 (file)
@@ -879,16 +879,17 @@ BT_HIDDEN
 struct bt_ctf_field_type *get_field_type(enum field_type_alias alias)
 {
        unsigned int alignment, size;
-       struct bt_ctf_field_type *field_type;
+       struct bt_ctf_field_type *field_type = NULL;
 
        if (alias >= NR_FIELD_TYPE_ALIAS) {
-               return NULL;
+               goto end;
        }
 
        alignment = field_type_aliases_alignments[alias];
        size = field_type_aliases_sizes[alias];
        field_type = bt_ctf_field_type_integer_create(size);
        bt_ctf_field_type_set_alignment(field_type, alignment);
+end:
        return field_type;
 }
 
This page took 0.024998 seconds and 4 git commands to generate.