test_printf: Remove custom appending of '|'
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 19 Oct 2021 14:26:19 +0000 (15:26 +0100)
committerPetr Mladek <pmladek@suse.com>
Wed, 27 Oct 2021 11:40:13 +0000 (13:40 +0200)
Instead of having an ifdef to decide whether to print a |, use the
'append' functionality of the main loop to print it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20211019142621.2810043-4-willy@infradead.org
lib/test_printf.c

index 4531063..ec58419 100644 (file)
@@ -616,12 +616,7 @@ page_flags_test(int section, int node, int zone, int last_cpupid,
        if (flags & PAGEFLAGS_MASK) {
                snprintf(cmp_buf + size, BUF_SIZE - size, "%s", name);
                size = strlen(cmp_buf);
-#if SECTIONS_WIDTH || NODES_WIDTH || ZONES_WIDTH || \
-       LAST_CPUPID_WIDTH || KASAN_TAG_WIDTH
-               /* Other information also included in page flags */
-               snprintf(cmp_buf + size, BUF_SIZE - size, "|");
-               size = strlen(cmp_buf);
-#endif
+               append = true;
        }
 
        for (i = 0; i < ARRAY_SIZE(pft); i++) {