Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+5 -5
+5 -5
lib/test_bitmap.c
··· 548 548 goto out; 549 549 550 550 time = ktime_get(); 551 - ret = bitmap_print_to_pagebuf(true, buf, bmap, PAGE_SIZE * 8); 551 + ret = scnprintf(buf, PAGE_SIZE, "%*pbl", (int)PAGE_SIZE * 8, bmap); 552 552 time = ktime_get() - time; 553 553 554 - if (ret != slen + 1) { 555 - pr_err("bitmap_print_to_pagebuf: result is %d, expected %d\n", ret, slen); 554 + if (ret != slen) { 555 + pr_err("bitmap_printlist: result is %d, expected %d\n", ret, slen); 556 556 failed_tests++; 557 557 goto out; 558 558 } 559 559 560 560 if (strncmp(buf, expected, slen)) { 561 - pr_err("bitmap_print_to_pagebuf: result is %s, expected %s\n", buf, expected); 561 + pr_err("bitmap_printlist: result is %s, expected %s\n", buf, expected); 562 562 failed_tests++; 563 563 goto out; 564 564 } 565 565 566 - pr_info("bitmap_print_to_pagebuf: input is '%s', Time: %llu\n", buf, time); 566 + pr_info("bitmap_printlist: input is '%s', Time: %llu\n", buf, time); 567 567 out: 568 568 kfree(buf); 569 569 kfree(bmap);