All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jessica Yu <jeyu@redhat.com>, Jiri Kosina <jikos@kernel.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Miroslav Benes <mbenes@suse.cz>,
	Anson Jacob <ansonjacob.aj@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused
Date: Thu, 2 Feb 2017 11:19:04 +0100	[thread overview]
Message-ID: <CAK8P3a118YShqjr4J=4HpAXcBH2ThtEUyxVJTrh9wg8=Wj3GHA@mail.gmail.com> (raw)
In-Reply-To: <87inot9c7e.fsf@rustcorp.com.au>

On Thu, Feb 2, 2017 at 10:25 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
>> clang warns about unused inline functions by default:
>>
>> arch/arm/crypto/aes-cipher-glue.c:68:1: warning: unused function '__inittest' [-Wunused-function]
>> arch/arm/crypto/aes-cipher-glue.c:69:1: warning: unused function '__exittest' [-Wunused-function]
>>
>> As these appear in every single module, let's just disable the warnings by marking the
>> two functions as __maybe_unused.
>
> Um, won't you have to do that to hundreds of kernel headers?  Why
> module.h?

clang specifically warns about inline functions that are defined in a
.c file but not used
there, but it is sensible enough to not warn about unused inline
functions that are defined
in a header.

In an ARM allmodconfig build, I currently see 178 .c files[1] that
have unused inline functions.
The proper way to deal with them is probably to move the warning into
the "make W=1"
level to hide it by default and then do one driver at a time.

The module.h definitions are special because the inline function is
defined through a
macro that gets evaluated by almost every loadable module, and we get
a warning for
every one of them, which the subsystem maintainers cannot deal with by
changing their
code locally.

    Arnd

[1] http://pastebin.com/pnHvbHQ3

  reply	other threads:[~2017-02-02 10:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 17:00 [PATCH] modules: mark __inittest/__exittest as __maybe_unused Arnd Bergmann
2017-02-02  9:25 ` Rusty Russell
2017-02-02 10:19   ` Arnd Bergmann [this message]
2017-02-02 18:55     ` Rusty Russell
2017-02-02 19:44 ` Miroslav Benes
2017-02-07  0:51 ` Jessica Yu

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='CAK8P3a118YShqjr4J=4HpAXcBH2ThtEUyxVJTrh9wg8=Wj3GHA@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=ansonjacob.aj@gmail.com \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=paul.gortmaker@windriver.com \
    --cc=rusty@rustcorp.com.au \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.