From b5e978f421236eab981ab2f4b3c3551ee8a1009a Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 24 Apr 2017 14:41:08 -0400 Subject: [PATCH] text.pretty: fix handle_notification() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- plugins/text/pretty/pretty.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/plugins/text/pretty/pretty.c b/plugins/text/pretty/pretty.c index 87efe05a..21272d41 100644 --- a/plugins/text/pretty/pretty.c +++ b/plugins/text/pretty/pretty.c @@ -127,30 +127,12 @@ enum bt_component_status handle_notification(struct pretty_component *pretty, { enum bt_component_status ret = BT_COMPONENT_STATUS_OK; - if (!pretty) { - ret = BT_COMPONENT_STATUS_ERROR; - goto end; - } + assert(pretty); - switch (bt_notification_get_type(notification)) { - case BT_NOTIFICATION_TYPE_PACKET_BEGIN: - break; - case BT_NOTIFICATION_TYPE_PACKET_END: - break; - case BT_NOTIFICATION_TYPE_EVENT: - { + if (bt_notification_get_type(notification) == BT_NOTIFICATION_TYPE_EVENT) { ret = pretty_print_event(pretty, notification); - if (ret != BT_COMPONENT_STATUS_OK) { - goto end; - } - break; } - case BT_NOTIFICATION_TYPE_STREAM_END: - break; - default: - puts("Unhandled notification type"); - } -end: + return ret; } -- 2.34.1