mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
vsprintf: Make %pGp print the hex value
All existing users of %pGp want the hex value as well as the decoded flag names. This looks awkward (passing the same parameter to printf twice), so move that functionality into the core. If we want, we can make that optional with flag arguments to %pGp in the future. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Yafang Shao <laoar.shao@gmail.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20211019142621.2810043-6-willy@infradead.org
This commit is contained in:
committed by
Petr Mladek
parent
507f986036
commit
23efd0804c
@@ -2023,6 +2023,11 @@ char *format_page_flags(char *buf, char *end, unsigned long flags)
|
||||
bool append = false;
|
||||
int i;
|
||||
|
||||
buf = number(buf, end, flags, default_flag_spec);
|
||||
if (buf < end)
|
||||
*buf = '(';
|
||||
buf++;
|
||||
|
||||
/* Page flags from the main area. */
|
||||
if (main_flags) {
|
||||
buf = format_flags(buf, end, main_flags, pageflag_names);
|
||||
@@ -2051,6 +2056,9 @@ char *format_page_flags(char *buf, char *end, unsigned long flags)
|
||||
|
||||
append = true;
|
||||
}
|
||||
if (buf < end)
|
||||
*buf = ')';
|
||||
buf++;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user