From 8bdcb82e988e2cbdc063880ff6a2c6a550789495 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 25 May 2015 16:09:27 -0400 Subject: [PATCH] Clean-up: get_field_type should only have one return statement MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/trace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/formats/ctf/ir/trace.c b/formats/ctf/ir/trace.c index 32de5bb5..158f2b8b 100644 --- a/formats/ctf/ir/trace.c +++ b/formats/ctf/ir/trace.c @@ -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; } -- 2.34.1