From 4526ba6908b141a77d711bb38d2971f640ce5a7e Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 12 May 2020 11:38:15 -0400 Subject: [PATCH] Cleanup: have interpreter functions return _DISCARD instead of 0 It's easier to understand the meaning of the zero return value of these function using the enum. It makes it obvious. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: Id8f199d82b17228fdc882e3ccbab8b3535840984 --- liblttng-ust/lttng-filter-interpreter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/liblttng-ust/lttng-filter-interpreter.c b/liblttng-ust/lttng-filter-interpreter.c index 6f13aa04..5255bb73 100644 --- a/liblttng-ust/lttng-filter-interpreter.c +++ b/liblttng-ust/lttng-filter-interpreter.c @@ -164,7 +164,7 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type) uint64_t lttng_filter_false(void *filter_data, const char *filter_stack_data) { - return 0; + return LTTNG_FILTER_DISCARD; } #ifdef INTERPRETER_USE_SWITCH @@ -793,7 +793,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; OP(FILTER_OP_RETURN): - /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */ + /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */ /* Handle dynamic typing. */ switch (estack_ax_t) { case REG_S64: @@ -810,7 +810,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, goto end; OP(FILTER_OP_RETURN_S64): - /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */ + /* LTTNG_FILTER_DISCARD or LTTNG_FILTER_RECORD_FLAG */ retval = !!estack_ax_v; ret = 0; goto end; @@ -2367,9 +2367,9 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, END_OP end: - /* return 0 (discard) on error */ + /* Return _DISCARD on error. */ if (ret) - return 0; + return LTTNG_FILTER_DISCARD; return retval; } -- 2.34.1