Skip to content

Commit 8b023ac

Browse files
nickdesaulniersPeter Zijlstra
authored andcommitted
lockdep: Fix -Wunused-parameter for _THIS_IP_
While looking into a bug related to the compiler's handling of addresses of labels, I noticed some uses of _THIS_IP_ seemed unused in lockdep. Drive by cleanup. -Wunused-parameter: kernel/locking/lockdep.c:1383:22: warning: unused parameter 'ip' kernel/locking/lockdep.c:4246:48: warning: unused parameter 'ip' kernel/locking/lockdep.c:4844:19: warning: unused parameter 'ip' Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Waiman Long <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ace1a98 commit 8b023ac

File tree

7 files changed

+21
-27
lines changed

7 files changed

+21
-27
lines changed

arch/arm64/kernel/entry-common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static __always_inline void __exit_to_kernel_mode(struct pt_regs *regs)
7575
if (interrupts_enabled(regs)) {
7676
if (regs->exit_rcu) {
7777
trace_hardirqs_on_prepare();
78-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
78+
lockdep_hardirqs_on_prepare();
7979
rcu_irq_exit();
8080
lockdep_hardirqs_on(CALLER_ADDR0);
8181
return;
@@ -121,7 +121,7 @@ static __always_inline void enter_from_user_mode(struct pt_regs *regs)
121121
static __always_inline void __exit_to_user_mode(void)
122122
{
123123
trace_hardirqs_on_prepare();
124-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
124+
lockdep_hardirqs_on_prepare();
125125
user_enter_irqoff();
126126
lockdep_hardirqs_on(CALLER_ADDR0);
127127
}
@@ -179,7 +179,7 @@ static void noinstr arm64_exit_nmi(struct pt_regs *regs)
179179
ftrace_nmi_exit();
180180
if (restore) {
181181
trace_hardirqs_on_prepare();
182-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
182+
lockdep_hardirqs_on_prepare();
183183
}
184184

185185
rcu_nmi_exit();
@@ -215,7 +215,7 @@ static void noinstr arm64_exit_el1_dbg(struct pt_regs *regs)
215215

216216
if (restore) {
217217
trace_hardirqs_on_prepare();
218-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
218+
lockdep_hardirqs_on_prepare();
219219
}
220220

221221
rcu_nmi_exit();

include/linux/irqflags.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
#ifdef CONFIG_PROVE_LOCKING
2121
extern void lockdep_softirqs_on(unsigned long ip);
2222
extern void lockdep_softirqs_off(unsigned long ip);
23-
extern void lockdep_hardirqs_on_prepare(unsigned long ip);
23+
extern void lockdep_hardirqs_on_prepare(void);
2424
extern void lockdep_hardirqs_on(unsigned long ip);
2525
extern void lockdep_hardirqs_off(unsigned long ip);
2626
#else
2727
static inline void lockdep_softirqs_on(unsigned long ip) { }
2828
static inline void lockdep_softirqs_off(unsigned long ip) { }
29-
static inline void lockdep_hardirqs_on_prepare(unsigned long ip) { }
29+
static inline void lockdep_hardirqs_on_prepare(void) { }
3030
static inline void lockdep_hardirqs_on(unsigned long ip) { }
3131
static inline void lockdep_hardirqs_off(unsigned long ip) { }
3232
#endif

include/linux/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static __always_inline void guest_state_enter_irqoff(void)
450450
{
451451
instrumentation_begin();
452452
trace_hardirqs_on_prepare();
453-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
453+
lockdep_hardirqs_on_prepare();
454454
instrumentation_end();
455455

456456
guest_context_enter_irqoff();

kernel/entry/common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static __always_inline void __exit_to_user_mode(void)
126126
{
127127
instrumentation_begin();
128128
trace_hardirqs_on_prepare();
129-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
129+
lockdep_hardirqs_on_prepare();
130130
instrumentation_end();
131131

132132
user_enter_irqoff();
@@ -416,7 +416,7 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state)
416416
instrumentation_begin();
417417
/* Tell the tracer that IRET will enable interrupts */
418418
trace_hardirqs_on_prepare();
419-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
419+
lockdep_hardirqs_on_prepare();
420420
instrumentation_end();
421421
rcu_irq_exit();
422422
lockdep_hardirqs_on(CALLER_ADDR0);
@@ -465,7 +465,7 @@ void noinstr irqentry_nmi_exit(struct pt_regs *regs, irqentry_state_t irq_state)
465465
ftrace_nmi_exit();
466466
if (irq_state.lockdep) {
467467
trace_hardirqs_on_prepare();
468-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
468+
lockdep_hardirqs_on_prepare();
469469
}
470470
instrumentation_end();
471471

kernel/locking/lockdep.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ static struct lock_list *alloc_list_entry(void)
13801380
*/
13811381
static int add_lock_to_list(struct lock_class *this,
13821382
struct lock_class *links_to, struct list_head *head,
1383-
unsigned long ip, u16 distance, u8 dep,
1383+
u16 distance, u8 dep,
13841384
const struct lock_trace *trace)
13851385
{
13861386
struct lock_list *entry;
@@ -3133,19 +3133,15 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
31333133
* to the previous lock's dependency list:
31343134
*/
31353135
ret = add_lock_to_list(hlock_class(next), hlock_class(prev),
3136-
&hlock_class(prev)->locks_after,
3137-
next->acquire_ip, distance,
3138-
calc_dep(prev, next),
3139-
*trace);
3136+
&hlock_class(prev)->locks_after, distance,
3137+
calc_dep(prev, next), *trace);
31403138

31413139
if (!ret)
31423140
return 0;
31433141

31443142
ret = add_lock_to_list(hlock_class(prev), hlock_class(next),
3145-
&hlock_class(next)->locks_before,
3146-
next->acquire_ip, distance,
3147-
calc_depb(prev, next),
3148-
*trace);
3143+
&hlock_class(next)->locks_before, distance,
3144+
calc_depb(prev, next), *trace);
31493145
if (!ret)
31503146
return 0;
31513147

@@ -4236,14 +4232,13 @@ static void __trace_hardirqs_on_caller(void)
42364232

42374233
/**
42384234
* lockdep_hardirqs_on_prepare - Prepare for enabling interrupts
4239-
* @ip: Caller address
42404235
*
42414236
* Invoked before a possible transition to RCU idle from exit to user or
42424237
* guest mode. This ensures that all RCU operations are done before RCU
42434238
* stops watching. After the RCU transition lockdep_hardirqs_on() has to be
42444239
* invoked to set the final state.
42454240
*/
4246-
void lockdep_hardirqs_on_prepare(unsigned long ip)
4241+
void lockdep_hardirqs_on_prepare(void)
42474242
{
42484243
if (unlikely(!debug_locks))
42494244
return;
@@ -4840,8 +4835,7 @@ EXPORT_SYMBOL_GPL(__lockdep_no_validate__);
48404835

48414836
static void
48424837
print_lock_nested_lock_not_held(struct task_struct *curr,
4843-
struct held_lock *hlock,
4844-
unsigned long ip)
4838+
struct held_lock *hlock)
48454839
{
48464840
if (!debug_locks_off())
48474841
return;
@@ -5017,7 +5011,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
50175011
chain_key = iterate_chain_key(chain_key, hlock_id(hlock));
50185012

50195013
if (nest_lock && !__lock_is_held(nest_lock, -1)) {
5020-
print_lock_nested_lock_not_held(curr, hlock, ip);
5014+
print_lock_nested_lock_not_held(curr, hlock);
50215015
return 0;
50225016
}
50235017

kernel/sched/idle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void __cpuidle default_idle_call(void)
102102
* last -- this is very similar to the entry code.
103103
*/
104104
trace_hardirqs_on_prepare();
105-
lockdep_hardirqs_on_prepare(_THIS_IP_);
105+
lockdep_hardirqs_on_prepare();
106106
rcu_idle_enter();
107107
lockdep_hardirqs_on(_THIS_IP_);
108108

kernel/trace/trace_preemptirq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void trace_hardirqs_on(void)
4646
this_cpu_write(tracing_irq_cpu, 0);
4747
}
4848

49-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
49+
lockdep_hardirqs_on_prepare();
5050
lockdep_hardirqs_on(CALLER_ADDR0);
5151
}
5252
EXPORT_SYMBOL(trace_hardirqs_on);
@@ -94,7 +94,7 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr)
9494
this_cpu_write(tracing_irq_cpu, 0);
9595
}
9696

97-
lockdep_hardirqs_on_prepare(CALLER_ADDR0);
97+
lockdep_hardirqs_on_prepare();
9898
lockdep_hardirqs_on(CALLER_ADDR0);
9999
}
100100
EXPORT_SYMBOL(trace_hardirqs_on_caller);

0 commit comments

Comments
 (0)