aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-24 16:09:23 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-27 17:56:03 -0400
commite6f7cfa0f0d432451b77d228f87287310f34d7c2 (patch)
tree88be970f437c5da7e31c804c35db98ea24c59189
parenta4b1ba5f874078f3a54ede67edd56f2b26ae079b (diff)
downloadlibtraceevent-e6f7cfa0f0d432451b77d228f87287310f34d7c2.tar.gz
libtraceevent: No need for testing ok in else if (!ok) in process_sizeof()
The if/else if logic in process_sizeof() has: if (ok || strcmp(token, "int") == 0) { [..] } else if (strcmp(token, "long") == 0) { [..] } else if (strcmp(token, "REC") == 0) { [..] } else if (!ok) { goto error; } By the time we get to } else if (!ok) {, ok will always be false as if it were true, it would enter the first if block. Just make it end with: } else { goto error; } Link: https://lore.kernel.org/linux-trace-devel/20230324200924.287521-3-rostedt@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--src/event-parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event-parse.c b/src/event-parse.c
index 2584b36..4a8b81c 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -3586,7 +3586,7 @@ process_sizeof(struct tep_event *event, struct tep_print_arg *arg, char **tok)
if (ret < 0)
goto error;
- } else if (!ok) {
+ } else {
goto error;
}