提交 a25a0854 编写于 作者: M Matthew Wilcox (Oracle) 提交者: Petr Mladek

test_printf: Remove separate page_flags variable

Keep flags intact so that we also test what happens when unknown flags
are passed to %pGp.
Signed-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: NYafang Shao <laoar.shao@gmail.com>
Reviewed-by: NPetr Mladek <pmladek@suse.com>
Signed-off-by: NPetr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20211019142621.2810043-3-willy@infradead.org
上级 c666d447
...@@ -605,17 +605,15 @@ static const struct page_flags_test pft[] = { ...@@ -605,17 +605,15 @@ static const struct page_flags_test pft[] = {
static void __init static void __init
page_flags_test(int section, int node, int zone, int last_cpupid, page_flags_test(int section, int node, int zone, int last_cpupid,
int kasan_tag, int flags, const char *name, char *cmp_buf) int kasan_tag, unsigned long flags, const char *name,
char *cmp_buf)
{ {
unsigned long values[] = {section, node, zone, last_cpupid, kasan_tag}; unsigned long values[] = {section, node, zone, last_cpupid, kasan_tag};
unsigned long page_flags = 0;
unsigned long size = 0; unsigned long size = 0;
bool append = false; bool append = false;
int i; int i;
flags &= PAGEFLAGS_MASK; if (flags & PAGEFLAGS_MASK) {
if (flags) {
page_flags |= flags;
snprintf(cmp_buf + size, BUF_SIZE - size, "%s", name); snprintf(cmp_buf + size, BUF_SIZE - size, "%s", name);
size = strlen(cmp_buf); size = strlen(cmp_buf);
#if SECTIONS_WIDTH || NODES_WIDTH || ZONES_WIDTH || \ #if SECTIONS_WIDTH || NODES_WIDTH || ZONES_WIDTH || \
...@@ -635,7 +633,7 @@ page_flags_test(int section, int node, int zone, int last_cpupid, ...@@ -635,7 +633,7 @@ page_flags_test(int section, int node, int zone, int last_cpupid,
size = strlen(cmp_buf); size = strlen(cmp_buf);
} }
page_flags |= (values[i] & pft[i].mask) << pft[i].shift; flags |= (values[i] & pft[i].mask) << pft[i].shift;
snprintf(cmp_buf + size, BUF_SIZE - size, "%s=", pft[i].name); snprintf(cmp_buf + size, BUF_SIZE - size, "%s=", pft[i].name);
size = strlen(cmp_buf); size = strlen(cmp_buf);
snprintf(cmp_buf + size, BUF_SIZE - size, pft[i].fmt, snprintf(cmp_buf + size, BUF_SIZE - size, pft[i].fmt,
...@@ -644,7 +642,7 @@ page_flags_test(int section, int node, int zone, int last_cpupid, ...@@ -644,7 +642,7 @@ page_flags_test(int section, int node, int zone, int last_cpupid,
append = true; append = true;
} }
test(cmp_buf, "%pGp", &page_flags); test(cmp_buf, "%pGp", &flags);
} }
static void __init static void __init
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册