]> www.infradead.org Git - linux.git/commitdiff
jbd2: use str_plural() to fix Coccinelle warning
authorThorsten Blum <thorsten.blum@toblux.com>
Tue, 2 Apr 2024 10:51:58 +0000 (12:51 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Jun 2024 13:34:00 +0000 (09:34 -0400)
Fixes the following Coccinelle/coccicheck warning reported by
string_choices.cocci:

opportunity for str_plural(dropped)

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Link: https://patch.msgid.link/20240402105157.254389-2-thorsten.blum@toblux.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/recovery.c

index 1f7664984d6e47b2ede19c00bdcf09672ccad7f5..af930c3d0d97b796b451aa91bc97da3789c25a5d 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/errno.h>
 #include <linux/crc32.h>
 #include <linux/blkdev.h>
+#include <linux/string_choices.h>
 #endif
 
 /*
@@ -374,7 +375,7 @@ int jbd2_journal_skip_recovery(journal_t *journal)
                        be32_to_cpu(journal->j_superblock->s_sequence);
                jbd2_debug(1,
                          "JBD2: ignoring %d transaction%s from the journal.\n",
-                         dropped, (dropped == 1) ? "" : "s");
+                         dropped, str_plural(dropped));
 #endif
                journal->j_transaction_sequence = ++info.end_transaction;
                journal->j_head = info.head_block;