diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-03-24 16:09:23 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-03-27 17:56:03 -0400 |
commit | e6f7cfa0f0d432451b77d228f87287310f34d7c2 (patch) | |
tree | 88be970f437c5da7e31c804c35db98ea24c59189 | |
parent | a4b1ba5f874078f3a54ede67edd56f2b26ae079b (diff) | |
download | libtraceevent-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.c | 2 |
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; } |