[PATCH v2 13/19] locking/lockdep: Remove unnecessary function pointer argument

From: Yuyang Du
Date: Mon Mar 18 2019 - 04:58:24 EST


check_prev_add() always has save_trace() as an input argument, which is
unnecessary.

Signed-off-by: Yuyang Du <duyuyang@xxxxxxxxx>
---
kernel/locking/lockdep.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 250ba64..de731b8 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2190,8 +2190,7 @@ static void print_deadlock_scenario(struct held_lock *nxt,
*/
static int
check_prev_add(struct task_struct *curr, struct held_lock *prev,
- struct held_lock *next, int distance, struct stack_trace *trace,
- int (*save)(struct stack_trace *trace))
+ struct held_lock *next, int distance, struct stack_trace *trace)
{
struct lock_list *uninitialized_var(target_entry);
struct lock_list *entry;
@@ -2231,11 +2230,11 @@ static void print_deadlock_scenario(struct held_lock *nxt,
if (unlikely(!ret)) {
if (!trace->entries) {
/*
- * If @save fails here, the printing might trigger
+ * If save_trace fails here, the printing might trigger
* a WARN but because of the !nr_entries it should
* not do bad things.
*/
- save(trace);
+ save_trace(trace);
}
print_circular_bug(&this, target_entry, next, prev, trace);
return 0;
@@ -2290,7 +2289,7 @@ static void print_deadlock_scenario(struct held_lock *nxt,
}


- if (!trace->entries && !save(trace))
+ if (!trace->entries && !save_trace(trace))
return 0;

/*
@@ -2355,7 +2354,7 @@ static void print_deadlock_scenario(struct held_lock *nxt,
* added:
*/
if (hlock->read != 2 && hlock->check) {
- int ret = check_prev_add(curr, hlock, next, distance, &trace, save_trace);
+ int ret = check_prev_add(curr, hlock, next, distance, &trace);
if (!ret)
return 0;

--
1.8.3.1