Messages in this thread | | | From | "Luck, Tony" <> | Subject | RE: [PATCH -v2] x86: Add an archinfo dumper module | Date | Fri, 5 Feb 2016 22:24:05 +0000 |
| |
+ show_reg_bits(m, "CR4", cr4_format, cr4);
Can %pXX formats use more than one argument? If so, we might be able to move all my code to lib/vsprintf.c and just write:
seq_printf(m, "CR4: %pBITS: 0x%lx\n", cr4_format, cr4, cr4);
If they can't, we could bundle the format and value into a structure:
struct printbits { char *fmt; u64 val; };
{ struct printbits p;
p.fmt = cr4_format; p.val = __read_cr4(); seq_printf(m, "CR4: %pBITS: 0x%lx\n", &p, p.val); }
-Tony
| |