__initdata and string tables, usage consensus?

Rafael Reilova (rreilova@ececs.uc.edu)
Mon, 13 Jul 1998 21:07:07 -0400 (EDT)


Hi,

I'm curious if there any consensus regarding the use of string tables and
the __initdata on 2.1.x kernels. As you all know, something like:

static char *table_foo[] __initdata {"string1", "string2", ....};

Only puts the pointers to the strings in the init.data section but does
not do the same for the actual strings. The same goes for local strings
used inside an __initfunc.

Currently the only way out is to name all strings, move them out of the
function or table, and declare each one as __initdata. I.e.

static char table_foo_string1[] __initdata = "string1";
static char table_foo_string2[] __initdata = "string2";
etc, etc...

Then do,

static char *table_foo[] __initdata{table_foo_string1,table_foo_string2,
........ };

My question is, is this uglyness warranted? And if so, When?

Also, I'm thinking of ways to avoid namespace pollution, since all strings
now become file-global at least. How about prefixing all strings from a
table with the table name, like above. Also, local function strings could
be prefixed with the function name.

I'm working on the Cyrix detection, and I have a lots of strings I don't
need once the boot process is over :)

Cheers,

Rafael

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html