Re: [PATCH v6 3/4] printk: Userspace format indexing support

From: Chris Down
Date: Tue May 18 2021 - 12:59:30 EST


Chris Down writes:
Andy Shevchenko writes:
As for the literals, are you saying that you prefer that it's symbolised as
a macro or static char, or do you know of an API where this kind of name can
be canonically accessed?

I have heard that modern GCC (at least) can utilize same constant literals in a
single compilation unit, so it won't be duplicated.

But more serious here is the guarantees of the name. Shouldn't it come from
KBuild / Makefile into some header like version do?

I'm not against that, but it seems like something worth doing outside of this patch series, unless you have strong feelings to the contrary?

More than happy to put that on my TODO list for tree-wide cleanups.

Now I think about it, we even just call it that in struct module's is_vmlinux, and set that by doing `strcmp(modname, "vmlinux") == 0`, so it seems pretty static from a terminology point of view.

It would be nice to just always use `mod->name`, but unfortunately with !CONFIG_MODULES we don't have `struct module` fleshed out at all in order to do so.