Skip to contentSkip to conversation

fgraph: Use str_plural() in test_graph_storage_single()

PATCH In review Jiapeng Chong 2 participants 2 messages Jun 18, 2024 – Jun 19, 2024 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fgraph: Use str_plural() in test_graph_storage_single()

Use existing str_plural() function rather than duplicating its implementation.

./kernel/trace/trace_selftest.c:880:56-60: opportunity for str_plural(size).

---
 kernel/trace/trace_selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_selftest.c +1 -1
index adf0f436d84b..97f1e4bc47dc 100644
@@ -877,7 +877,7 @@ static int __init test_graph_storage_single(struct fgraph_fixture *fixture)
 	int ret;
 
 	pr_cont("PASSED\n");
-	pr_info("Testing fgraph storage of %d byte%s: ", size, size > 1 ? "s" : "");
+	pr_info("Testing fgraph storage of %d byte%s: ", size, str_plural(size));
 
 	ret = init_fgraph_fixture(fixture);
 	if (ret && ret != -ENODEV) {
Signature · 1 line
2.20.1.7.g153144c
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Tue, 18 Jun 2024 15:20:14 +0800 Jiapeng Chong…

Use existing str_plural() function rather than duplicating its implementation.

./kernel/trace/trace_selftest.c:880:56-60: opportunity for str_plural(size).

Thanks, this looks good to me.

Quoted 20 lines
---
 kernel/trace/trace_selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_selftest.c +1 -1
index adf0f436d84b..97f1e4bc47dc 100644
@@ -877,7 +877,7 @@ static int __init test_graph_storage_single(struct fgraph_fixture *fixture)
 	int ret;
 
 	pr_cont("PASSED\n");
-	pr_info("Testing fgraph storage of %d byte%s: ", size, size > 1 ? "s" : "");
+	pr_info("Testing fgraph storage of %d byte%s: ", size, str_plural(size));
 
 	ret = init_fgraph_fixture(fixture);
 	if (ret && ret != -ENODEV) {
Signature · 1 line
2.20.1.7.g153144c
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>