summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@toblux.com>2024-05-28 14:00:09 +0200
committerBoqun Feng <boqun.feng@gmail.com>2024-08-06 10:46:42 -0700
commit13c267f0c27e35ee9372d3cf0dde1ea09db02f13 (patch)
treed4770ba4e3b33a3f45cff756c21d4babbf2d58c4
parentd5934e76316e84eced836b6b2bafae1837d1cd58 (diff)
downloadlinux-13c267f0c27e35ee9372d3cf0dde1ea09db02f13.tar.gz
linux-13c267f0c27e35ee9372d3cf0dde1ea09db02f13.tar.bz2
linux-13c267f0c27e35ee9372d3cf0dde1ea09db02f13.zip
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
-rw-r--r--kernel/locking/lockdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index fee21f3c3b99..266f57f36f69 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -785,7 +785,7 @@ static void lockdep_print_held_locks(struct task_struct *p)
printk("no locks held by %s/%d.\n", p->comm, task_pid_nr(p));
else
printk("%d lock%s held by %s/%d:\n", depth,
- depth > 1 ? "s" : "", p->comm, task_pid_nr(p));
+ str_plural(depth), p->comm, task_pid_nr(p));
/*
* It's not reliable to print a task's held locks if it's not sleeping
* and it's not the current task.