mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
tracing/probes: Remove redundant bounds check in trace_probe_compare_arg_type()
In trace_probe_compare_arg_type(), prior to entering the comparison loop, a->nr_args and b->nr_args are checked for equality. Since the loop condition is i < a->nr_args, i is guaranteed to be less than b->nr_args inside the loop. Remove the redundant (b->nr_args <= i) check. Link: https://lore.kernel.org/all/178454423769.296567.6694636865644203423.stgit@devnote2/ Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
This commit is contained in:
parent
794b5640aa
commit
6e9328ed75
|
|
@ -2770,10 +2770,9 @@ int trace_probe_compare_arg_type(struct trace_probe *a, struct trace_probe *b)
|
|||
return b->nr_args + 1;
|
||||
|
||||
for (i = 0; i < a->nr_args; i++) {
|
||||
if ((b->nr_args <= i) ||
|
||||
((a->args[i].type != b->args[i].type) ||
|
||||
(a->args[i].count != b->args[i].count) ||
|
||||
strcmp(a->args[i].name, b->args[i].name)))
|
||||
if ((a->args[i].type != b->args[i].type) ||
|
||||
(a->args[i].count != b->args[i].count) ||
|
||||
strcmp(a->args[i].name, b->args[i].name))
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user