LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Nick Alcock <nick.alcock@oracle.com>,
	jeyu@kernel.org, masahiroy@kernel.org
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	arnd@arndb.de, eugene.loh@oracle.com, kris.van.hees@oracle.com
Subject: Re: [PATCH v5 6/7] kallsyms: add /proc/kallmodsyms
Date: Thu, 28 Oct 2021 22:52:13 +0100	[thread overview]
Message-ID: <878rycrf5e.fsf@esperi.org.uk> (raw)
In-Reply-To: <202110281914.lE4Jfz7P-lkp@intel.com> (kernel test robot's message of "Thu, 28 Oct 2021 19:36:46 +0800")

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:

>>> 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)

  reply	other threads:[~2021-10-28 21:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 21:51 [PATCH v5] kallsyms: new /proc/kallmodsyms with builtin modules Nick Alcock
2021-09-29 21:51 ` [PATCH v5 1/7] kbuild: bring back tristate.conf Nick Alcock
2021-09-29 21:51 ` [PATCH v5 2/7] kbuild: add modules_thick.builtin Nick Alcock
2021-09-29 21:51 ` [PATCH v5 3/7] kbuild: generate an address ranges map at vmlinux link time Nick Alcock
2021-09-29 21:51 ` [PATCH v5 4/7] kallsyms: introduce sections needed to map symbols to built-in modules Nick Alcock
2021-09-29 21:51 ` [PATCH v5 5/7] kallsyms: optimize .kallsyms_modules* Nick Alcock
2021-09-29 21:51 ` [PATCH v5 6/7] kallsyms: add /proc/kallmodsyms Nick Alcock
2021-09-29 21:51 ` [PATCH v5 7/7] kallsyms: add reliable symbol size info Nick Alcock
2021-09-29 23:34 ` [PATCH v5] kallsyms: new /proc/kallmodsyms with builtin modules Kees Cook
2021-09-30 17:19   ` Nick Alcock
2021-09-30 17:53     ` Kees Cook
2021-10-27 17:46 ` [PING PATCH " Nick Alcock
2021-10-27 17:47   ` [PATCH v5 1/7] kbuild: bring back tristate.conf Nick Alcock
2021-10-27 17:47   ` [PATCH v5 2/7] kbuild: add modules_thick.builtin Nick Alcock
2021-10-27 17:47   ` [PATCH v5 3/7] kbuild: generate an address ranges map at vmlinux link time Nick Alcock
2021-10-30 16:49     ` kernel test robot
2021-10-27 17:47   ` [PATCH v5 4/7] kallsyms: introduce sections needed to map symbols to built-in modules Nick Alcock
2021-10-27 17:47   ` [PATCH v5 5/7] kallsyms: optimize .kallsyms_modules* Nick Alcock
2021-10-27 17:47   ` [PATCH v5 6/7] kallsyms: add /proc/kallmodsyms Nick Alcock
2021-10-28 11:36     ` kernel test robot
2021-10-28 21:52       ` Nick Alcock [this message]
2021-10-27 17:47   ` [PATCH v5 7/7] kallsyms: add reliable symbol size info Nick Alcock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rycrf5e.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=arnd@arndb.de \
    --cc=eugene.loh@oracle.com \
    --cc=jeyu@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kris.van.hees@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --subject='Re: [PATCH v5 6/7] kallsyms: add /proc/kallmodsyms' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).