From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751370AbdBBJZt (ORCPT ); Thu, 2 Feb 2017 04:25:49 -0500 Received: from ozlabs.org ([103.22.144.67]:49701 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdBBJZp (ORCPT ); Thu, 2 Feb 2017 04:25:45 -0500 From: Rusty Russell To: Arnd Bergmann , Jessica Yu Cc: Arnd Bergmann , Jiri Kosina , Paul Gortmaker , Miroslav Benes , Anson Jacob , linux-kernel@vger.kernel.org Subject: Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused In-Reply-To: <20170201170028.2645354-1-arnd@arndb.de> References: <20170201170028.2645354-1-arnd@arndb.de> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Thu, 02 Feb 2017 19:55:09 +1030 Message-ID: <87inot9c7e.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann 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? Confused, Rusty. > Signed-off-by: Arnd Bergmann > --- > include/linux/module.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/module.h b/include/linux/module.h > index 38b4b2c754c8..48a5c57c858e 100644 > --- a/include/linux/module.h > +++ b/include/linux/module.h > @@ -126,13 +126,13 @@ extern void cleanup_module(void); > > /* Each module must use one module_init(). */ > #define module_init(initfn) \ > - static inline initcall_t __inittest(void) \ > + static inline initcall_t __maybe_unused __inittest(void) \ > { return initfn; } \ > int init_module(void) __attribute__((alias(#initfn))); > > /* This is only required if you want to be unloadable. */ > #define module_exit(exitfn) \ > - static inline exitcall_t __exittest(void) \ > + static inline exitcall_t __maybe_unused __exittest(void) \ > { return exitfn; } \ > void cleanup_module(void) __attribute__((alias(#exitfn))); > > -- > 2.9.0