Skip to contentSkip to conversation

mm/page_owner: fix %pGp format specifier argument type

PATCH Applied Zhen Ni 2 participants 2 messages Apr 14

Subsystems (2)
lore
Share & tools
lore

Zhen Ni

author
#0 lore raw

PATCH 1/1 mm/page_owner: fix %pGp format specifier argument type

The %pGp format specifier expects an argument of type 'unsigned long *', but page->flags is now of type 'memdesc_flags_t' (a struct containing an unsigned long member 'f') after the introduction of memdesc_flags_t.

Fix the type mismatch by passing &page->flags.f instead of &page->flags, which matches the expected type.

Fixes 53fbef56e07d ("mm: introduce memdesc_flags_t")
---
 mm/page_owner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_owner.c +1 -1
index 8178e0be557f..2dddcb6510aa 100644
@@ -573,7 +573,7 @@ print_page_owner(char __user *buf, size_t count, unsigned long pfn,
 			migratetype_names[page_mt],
 			pfn >> pageblock_order,
 			migratetype_names[pageblock_mt],
-			&page->flags);
+			&page->flags.f);
 
 	ret += stack_depot_snprint(handle, kbuf + ret, count - ret, 0);
 	if (ret >= count)
Signature · 1 line
2.20.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Zhen Ni

The %pGp format specifier expects an argument of type 'unsigned long *', but page->flags is now of type 'memdesc_flags_t' (a struct containing an unsigned long member 'f') after the introduction of memdesc_flags_t.

Fix the type mismatch by passing &page->flags.f instead of &page->flags, which matches the expected type.

I think this has no visible effects as memdesc_flags_t just wraps unsigned long, so it's not an urgent fix. Things could break if we modified memdesc_flags_t further, or compiler/some tool got smart enough to flag the mismath.

Quoted 2 lines
Fixes 53fbef56e07d ("mm: introduce memdesc_flags_t")
Quoted 17 lines
---
 mm/page_owner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_owner.c +1 -1
index 8178e0be557f..2dddcb6510aa 100644
@@ -573,7 +573,7 @@ print_page_owner(char __user *buf, size_t count, unsigned long pfn,
 			migratetype_names[page_mt],
 			pfn >> pageblock_order,
 			migratetype_names[pageblock_mt],
-			&page->flags);
+			&page->flags.f);
 
 	ret += stack_depot_snprint(handle, kbuf + ret, count - ret, 0);
 	if (ret >= count)