Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572688

Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused

From Rusty Russell <rusty@rustcorp.com.au>
Newsgroups linux.kernel
Subject Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused
Date 2017-02-02 20:20 +0100
Message-ID <t6v5g-85X-3@gated-at.bofh.it> (permalink)
References <t66zU-fo-27@gated-at.bofh.it> <t6lSi-1ZO-13@gated-at.bofh.it> <t6mEG-2zZ-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Arnd Bergmann <arnd@arndb.de> writes:
> 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.

Ah, I was confused because you patched the header :)

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

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Thanks,
Rusty.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] modules: mark __inittest/__exittest as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2017-02-01 18:10 +0100
  Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused Rusty Russell <rusty@rustcorp.com.au> - 2017-02-02 10:30 +0100
    Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2017-02-02 11:20 +0100
      Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused Rusty Russell <rusty@rustcorp.com.au> - 2017-02-02 20:20 +0100
  Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused Miroslav Benes <mbenes@suse.cz> - 2017-02-02 20:50 +0100
  Re: modules: mark __inittest/__exittest as __maybe_unused Jessica Yu <jeyu@redhat.com> - 2017-02-07 02:00 +0100

csiph-web