[PATCH] bpf: use str_plural() in diag_print_history()
From: Lalit Shankar Chowdhury
Date: Thu Sep 17 2026 - 16:48:07 EST
Use the string choice helper function to simplify the code.
Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@xxxxxxxxx>
---
kernel/bpf/diagnostics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/diagnostics.c b/kernel/bpf/diagnostics.c
index 0abbbe177e31..ff139777ac64 100644
--- a/kernel/bpf/diagnostics.c
+++ b/kernel/bpf/diagnostics.c
@@ -2354,6 +2354,6 @@ static void diag_print_history(struct bpf_verifier_env *env,
if (log->first_seq)
diag_write(env, " %llu older causal-history event%s not retained because diagnostic "
"event storage reached capacity\n",
- log->first_seq, log->first_seq == 1 ? "" : "s");
+ log->first_seq, str_plural(log->first_seq));
diag_fmt_restore(env, mark);
}
--
2.53.0