From a93d4e71141238b3d87471461c6920e6f7547367 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 12 May 2020 11:48:20 -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: I1df8f704fa9f6768f413c12c3c1de61a94b3aff8 --- src/lttng-filter-interpreter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lttng-filter-interpreter.c b/src/lttng-filter-interpreter.c index 9599f9a6..6c1c2f27 100644 --- a/src/lttng-filter-interpreter.c +++ b/src/lttng-filter-interpreter.c @@ -221,7 +221,7 @@ uint64_t lttng_filter_false(void *filter_data, struct lttng_probe_ctx *lttng_probe_ctx, const char *filter_stack_data) { - return 0; + return LTTNG_FILTER_DISCARD; } #ifdef INTERPRETER_USE_SWITCH @@ -771,7 +771,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data, OP(FILTER_OP_RETURN): 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; @@ -1567,9 +1567,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