mm/page_owner: fix %pGp format specifier argument type
Subsystems (2)
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.
--- mm/page_owner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_owner.c +1 -1
@@ -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
Quoted 6 lines · Zhen Ni
The %pGp format specifier expects an argument of type 'unsigned long *', but
page->flagsis now of type 'memdesc_flags_t' (a struct containing an unsigned long member 'f') after the introduction ofmemdesc_flags_t.Fix the type mismatch by passing
&page->flags.finstead 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")Signed-off-by Zhen Ni <[email protected]>
Quoted 17 lines
--- mm/page_owner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/page_owner.c +1
-1@@ -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)