Thread (1 message) 1 message, 1 author, 2021-10-28

Re: [PATCH v5 6/7] kallsyms: add /proc/kallmodsyms

From: Nick Alcock <hidden>
Date: 2021-10-28 21:52:46
Also in: lkml, llvm, oe-kbuild-all

For reference, and to be maximally pedantic:

On 28 Oct 2021, kernel test robot said:
Hi Nick,

Thank you for the patch! Perhaps something to improve:
Nope! This is a (very small) flaw in the !CONFIG_PROC_FS case in
include/linux/proc_fs.h. (I don't think one can seriously call it a
*bug*, as such.)

It's not a problem in this patch.
config: hexagon-randconfig-r041-20211027 (attached as .config)
This config includes: 

# CONFIG_PROC_FS is not set
All warnings (new ones prefixed by >>):
[unrelated warnings snipped]
   static 
   kernel/kallsyms.c:1054:30: warning: unused variable 'kallsyms_proc_ops' [-Wunused-const-variable]
   static const struct proc_ops kallsyms_proc_ops = {
                                ^
This warning already existed (and doubtless countless others just like
it all over the tree in this configuration).  This is because
proc_create(), in the !CONFIG_PROC_FS case, is a #define that just does
nothing: so the compiler can see that none of its args are used, and
will complain about those that have no other references. The proc_ops is
almost certainly going to be one such.

The new warning is just the same:
quoted
quoted
kernel/kallsyms.c:1062:30: warning: unused variable 'kallmodsyms_proc_ops' [-Wunused-const-variable]
   static const struct proc_ops kallmodsyms_proc_ops = {
                                ^
   3 warnings generated.
The kallmodsyms_proc_ops is obviously doing the same thing as
kallsyms_proc_ops (because it has to), so it gets the same warning.

Short of wrapping every single declaration of a proc_ops structure, and
every call to proc_create, in #ifdef CONFIG_PROC_FS (which is obviously
gross and exactly the thing the macro in proc_fs.h is intended to
avoid), there is no way of fixing this warning on its own: it must be
fixed in proc_fs.h. (Perhaps by making a bunch of those macros into
functions with __attribute__((__unused__)) attached to appropriate
args.)

-- 
NULL && (void)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help