From: Thorsten Blum Date: Tue, 28 May 2024 12:00:09 +0000 (+0200) Subject: lockdep: Use str_plural() to fix Coccinelle warning X-Git-Tag: v6.12-rc1~8^2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13c267f0c27e35ee9372d3cf0dde1ea09db02f13;p=thirdparty%2Flinux.git 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 Signed-off-by: Thorsten Blum Signed-off-by: Boqun Feng Link: https://lore.kernel.org/r/20240528120008.403511-2-thorsten.blum@toblux.com --- diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index fee21f3c3b997..266f57f36f697 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.