summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Norov <ynorov@nvidia.com>2026-02-19 21:13:57 +0300
committerYury Norov <ynorov@nvidia.com>2026-03-23 20:33:51 +0300
commitd1a43793c484e4f1e896dd2fee52b034f8c4f965 (patch)
treed5abf5064d6afb0ebba4d80d4e94f67e1286c66f
parent6b5a4b68736798df1031404a2fad06d031253ef7 (diff)
downloadlinux-d1a43793c484e4f1e896dd2fee52b034f8c4f965.tar.xz
bitmap: switch test to scnprintf("%*pbl")
scnprintf("%*pbl") is more verbose than bitmap_print_to_pagebuf(). Switch the test to using it. This also improves the test output because bitmap_print_to_pagebuf() adds \n at the end of the printed bitmap, which breaks the test format. Signed-off-by: Yury Norov <ynorov@nvidia.com>
-rw-r--r--lib/test_bitmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 2952a6147e81..8d07b5411897 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -548,22 +548,22 @@ static void __init test_bitmap_printlist(void)
goto out;
time = ktime_get();
- ret = bitmap_print_to_pagebuf(true, buf, bmap, PAGE_SIZE * 8);
+ ret = scnprintf(buf, PAGE_SIZE, "%*pbl", (int)PAGE_SIZE * 8, bmap);
time = ktime_get() - time;
- if (ret != slen + 1) {
- pr_err("bitmap_print_to_pagebuf: result is %d, expected %d\n", ret, slen);
+ if (ret != slen) {
+ pr_err("bitmap_printlist: result is %d, expected %d\n", ret, slen);
failed_tests++;
goto out;
}
if (strncmp(buf, expected, slen)) {
- pr_err("bitmap_print_to_pagebuf: result is %s, expected %s\n", buf, expected);
+ pr_err("bitmap_printlist: result is %s, expected %s\n", buf, expected);
failed_tests++;
goto out;
}
- pr_info("bitmap_print_to_pagebuf: input is '%s', Time: %llu\n", buf, time);
+ pr_info("bitmap_printlist: input is '%s', Time: %llu\n", buf, time);
out:
kfree(buf);
kfree(bmap);