[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Feb 2017 11:19:04 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: Jessica Yu <jeyu@...hat.com>, Jiri Kosina <jikos@...nel.org>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Miroslav Benes <mbenes@...e.cz>,
Anson Jacob <ansonjacob.aj@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused
On Thu, Feb 2, 2017 at 10:25 AM, Rusty Russell <rusty@...tcorp.com.au> wrote:
> Arnd Bergmann <arnd@...db.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
Powered by blists - more mailing lists