lkml.org 
[lkml]   [2016]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH -v2] x86: Add an archinfo dumper module
Date
+	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

\
 
 \ /
  Last update: 2016-02-05 23:41    [W:0.111 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site