From: Petr Mladek Date: Tue, 2 Nov 2021 09:39:27 +0000 (+0100) Subject: Merge branch 'for-5.16-vsprintf-pgp' into for-linus X-Git-Url: https://repo.jachan.dev/J-linux.git/commitdiff_plain/40e64a88dadcfa168914065baf7f035de957bbe0?hp=-c Merge branch 'for-5.16-vsprintf-pgp' into for-linus --- 40e64a88dadcfa168914065baf7f035de957bbe0 diff --combined lib/vsprintf.c index 1173930ed9d3,214098248610..f90f91d83920 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@@ -17,7 -17,7 +17,7 @@@ * - scnprintf and vscnprintf */ - #include + #include #include #include #include @@@ -408,9 -408,8 +408,9 @@@ int num_to_str(char *buf, int size, uns #define SMALL 32 /* use lowercase in hex (must be 32 == 0x20) */ #define SPECIAL 64 /* prefix hex with "0x", octal with "0" */ +static_assert(SIGN == 1); static_assert(ZEROPAD == ('0' - ' ')); -static_assert(SMALL == ' '); +static_assert(SMALL == ('a' ^ 'A')); enum format_type { FORMAT_TYPE_NONE, /* Just a string part */ @@@ -2020,10 -2019,15 +2020,15 @@@ static const struct page_flags_fields p static char *format_page_flags(char *buf, char *end, unsigned long flags) { - unsigned long main_flags = flags & (BIT(NR_PAGEFLAGS) - 1); + unsigned long main_flags = flags & PAGEFLAGS_MASK; 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); @@@ -2052,6 -2056,9 +2057,9 @@@ append = true; } + if (buf < end) + *buf = ')'; + buf++; return buf; }