Skip to content

Commit

Permalink
ftrace: Simplify ftrace hash lookup code in clear_func_from_hash()
Browse files Browse the repository at this point in the history
Function ftrace_lookup_ip() will check empty hash table. So we don't
need extra check outside.

Link: http://lkml.kernel.org/r/[email protected]

Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
changbindu authored and rostedt committed Sep 17, 2019
1 parent ac68154 commit 0846875
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6036,11 +6036,7 @@ clear_func_from_hash(struct ftrace_init_func *func, struct ftrace_hash *hash)
{
struct ftrace_func_entry *entry;

if (ftrace_hash_empty(hash))
return;

entry = __ftrace_lookup_ip(hash, func->ip);

entry = ftrace_lookup_ip(hash, func->ip);
/*
* Do not allow this rec to match again.
* Yeah, it may waste some memory, but will be removed
Expand Down

0 comments on commit 0846875

Please sign in to comment.