RE: [PATCH -v2] x86: Add an archinfo dumper module
From: Luck, Tony
Date: Fri Feb 05 2016 - 17:24:13 EST
+ 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