Skip to content

Commit 13c267f

Browse files
tobluxfbq
authored andcommitted
lockdep: Use str_plural() to fix Coccinelle warning
Fixes the following Coccinelle/coccicheck warning reported by string_choices.cocci: opportunity for str_plural(depth) Acked-by: Waiman Long <longman@redhat.com> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20240528120008.403511-2-thorsten.blum@toblux.com
1 parent d5934e7 commit 13c267f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/locking/lockdep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static void lockdep_print_held_locks(struct task_struct *p)
785785
printk("no locks held by %s/%d.\n", p->comm, task_pid_nr(p));
786786
else
787787
printk("%d lock%s held by %s/%d:\n", depth,
788-
depth > 1 ? "s" : "", p->comm, task_pid_nr(p));
788+
str_plural(depth), p->comm, task_pid_nr(p));
789789
/*
790790
* It's not reliable to print a task's held locks if it's not sleeping
791791
* and it's not the current task.

0 commit comments

Comments
 (0)