]> Git Repo - J-linux.git/commitdiff
lockdep: Use str_plural() to fix Coccinelle warning
authorThorsten Blum <[email protected]>
Tue, 28 May 2024 12:00:09 +0000 (14:00 +0200)
committerBoqun Feng <[email protected]>
Tue, 6 Aug 2024 17:46:42 +0000 (10:46 -0700)
Fixes the following Coccinelle/coccicheck warning reported by
string_choices.cocci:

opportunity for str_plural(depth)

Acked-by: Waiman Long <[email protected]>
Signed-off-by: Thorsten Blum <[email protected]>
Signed-off-by: Boqun Feng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
kernel/locking/lockdep.c

index fee21f3c3b9972095587b315cc191ebab8d9653e..266f57f36f697d36da630842f877416a50d138da 100644 (file)
@@ -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.
This page took 0.055273 seconds and 4 git commands to generate.