From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751516AbdFFV2H (ORCPT ); Tue, 6 Jun 2017 17:28:07 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:36598 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbdFFV2F (ORCPT ); Tue, 6 Jun 2017 17:28:05 -0400 MIME-Version: 1.0 In-Reply-To: <20170606212354.GZ141096@google.com> References: <20170530181306.GV141096@google.com> <20170531235519.GX141096@google.com> <20170606212354.GZ141096@google.com> From: Linus Torvalds Date: Tue, 6 Jun 2017 14:28:03 -0700 X-Google-Sender-Auth: Q8qfxnBztWQ8Y4B6FF2xCxVLLjo Message-ID: Subject: Re: [RFC] clang: 'unused-function' warning on static inline functions To: Matthias Kaehlcke Cc: Arnd Bergmann , Linux Kernel Mailing List , Andrew Morton , Greg Kroah-Hartman , Ingo Molnar , Thomas Gleixner , Christoph Hellwig , Jens Axboe , Steven Rostedt , David Rientjes , Douglas Anderson , Guenter Roeck , Mark Brown , David Miller Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 6, 2017 at 2:23 PM, Matthias Kaehlcke wrote: > > I tend to disagree, the warning is useful to detect truly unused > static inline functions, which should be removed, rather than be > carried around/maintained for often long periods of time. That may be true in other projects, but we really do have a lot of code that is conditionally used. The warning is just not useful. I agree that we could use "__maybe_unused", but at the same time, I don't really see the point. There's no way in hell we'd ever do that for inlines that are in header files (*of course* they may be unused), why would we then haev a magical rule like "let's do it for inlines in C files". I applied the patch from David Rientjes to just make "inline" automatically mean "maybe unused" for clang. Linus