From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751602AbdBBTOm (ORCPT ); Thu, 2 Feb 2017 14:14:42 -0500 Received: from ozlabs.org ([103.22.144.67]:51005 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751359AbdBBTOl (ORCPT ); Thu, 2 Feb 2017 14:14:41 -0500 From: Rusty Russell To: Arnd Bergmann Cc: Jessica Yu , Jiri Kosina , Paul Gortmaker , Miroslav Benes , Anson Jacob , Linux Kernel Mailing List Subject: Re: [PATCH] modules: mark __inittest/__exittest as __maybe_unused In-Reply-To: References: <20170201170028.2645354-1-arnd@arndb.de> <87inot9c7e.fsf@rustcorp.com.au> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 03 Feb 2017 05:25:03 +1030 Message-ID: <87fujwa0e0.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: > On Thu, Feb 2, 2017 at 10:25 AM, Rusty Russell wrote: >> 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? > > 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 Thanks, Rusty.