Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-08 Thread Arnd Bergmann
On Wed, Jun 7, 2017 at 9:43 PM, Arnd Bergmann wrote: > On Tue, Jun 6, 2017 at 11:28 PM, Linus Torvalds > wrote: > I even found one function that should be called but is not: > __ila_hash_secret_init(). This one might be a serious bug, > or it might be harmless. > > [Adding Tom Herbert to Cc her

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-07 Thread Steven Rostedt
On Wed, 7 Jun 2017 13:36:27 -0700 Linus Torvalds wrote: > On Wed, Jun 7, 2017 at 12:43 PM, Arnd Bergmann wrote: > > > > The main reason I see for it is that a lot of the unused inline functions > > in C files are mistakes, > > Bah. Blah blah blah. > > The clang warnign doesn't actually reall

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-07 Thread Linus Torvalds
On Wed, Jun 7, 2017 at 12:43 PM, Arnd Bergmann wrote: > > The main reason I see for it is that a lot of the unused inline functions > in C files are mistakes, Bah. Blah blah blah. The clang warnign doesn't actually really buy us anything, and it's a completely pointless difference to gcc. I'm n

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-07 Thread Arnd Bergmann
On Tue, Jun 6, 2017 at 11:28 PM, Linus Torvalds wrote: > 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

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-07 Thread Arnd Bergmann
On Wed, Jun 7, 2017 at 2:58 PM, Steven Rostedt wrote: > On Wed, 7 Jun 2017 10:17:18 +0200 > Arnd Bergmann wrote: >> > where it is truly just dead junk. I'd rather just leave the dead junk >> > than have pointless warnings, if I have to choose one of the two >> > outcomes. >> >> This is a relativ

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-07 Thread Steven Rostedt
On Wed, 7 Jun 2017 10:17:18 +0200 Arnd Bergmann wrote: > On Tue, Jun 6, 2017 at 11:29 PM, Jens Axboe wrote: > > On 06/06/2017 03:23 PM, Matthias Kaehlcke wrote: > >> El Tue, Jun 06, 2017 at 09:32:35AM -0700 Linus Torvalds ha dit: > >> > >>> On Tue, Jun 6, 2017 at 4:16 AM, Arnd Bergmann wrot

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-07 Thread Arnd Bergmann
On Tue, Jun 6, 2017 at 11:29 PM, Jens Axboe wrote: > On 06/06/2017 03:23 PM, Matthias Kaehlcke wrote: >> El Tue, Jun 06, 2017 at 09:32:35AM -0700 Linus Torvalds ha dit: >> >>> On Tue, Jun 6, 2017 at 4:16 AM, Arnd Bergmann wrote: Those should all be fairly easy to address, I'd vote for l

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread David Rientjes
On Tue, 6 Jun 2017, Matthias Kaehlcke wrote: > Unfortunately as is the patch doesn't work: > > include/linux/compiler-clang.h:20:9: error: 'inline' macro redefined > [-Werror,-Wmacro-redefined] > #define inline inline __attribute__((unused)) > ^ > include/linux/compiler-gcc.h:78:9: note:

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread Matthias Kaehlcke
El Tue, Jun 06, 2017 at 02:28:03PM -0700 Linus Torvalds ha dit: > I applied the patch from David Rientjes to just make "inline" > automatically mean "maybe unused" for clang. Unfortunately as is the patch doesn't work: include/linux/compiler-clang.h:20:9: error: 'inline' macro redefined [-Werro

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread Jens Axboe
On 06/06/2017 03:23 PM, Matthias Kaehlcke wrote: > El Tue, Jun 06, 2017 at 09:32:35AM -0700 Linus Torvalds ha dit: > >> On Tue, Jun 6, 2017 at 4:16 AM, Arnd Bergmann wrote: >>> >>> Those should all be fairly easy to address, I'd vote for leaving the >>> warning enabled >>> in clang, and possibly

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread Linus Torvalds
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 r

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread Matthias Kaehlcke
El Tue, Jun 06, 2017 at 09:32:35AM -0700 Linus Torvalds ha dit: > On Tue, Jun 6, 2017 at 4:16 AM, Arnd Bergmann wrote: > > > > Those should all be fairly easy to address, I'd vote for leaving the > > warning enabled > > in clang, and possibly asking the gcc maintainers to add a similar feature >

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread Linus Torvalds
On Tue, Jun 6, 2017 at 4:16 AM, Arnd Bergmann wrote: > > Those should all be fairly easy to address, I'd vote for leaving the > warning enabled > in clang, and possibly asking the gcc maintainers to add a similar feature for > warning about it. Hell no. That warning is pointless shit. The functi

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-06-06 Thread Arnd Bergmann
On Thu, Jun 1, 2017 at 1:55 AM, Matthias Kaehlcke wrote: >> ASoC: Intel: sst: Delete sst_shim_regs64; saved regs are never used >> https://patchwork.kernel.org/patch/9754923/ >> >> The goal of this thread is to arrive to a conclusion on how to deal >> with the warning. If we want clang to help to

Re: [RFC] clang: 'unused-function' warning on static inline functions

2017-05-31 Thread Matthias Kaehlcke
El Tue, May 30, 2017 at 11:13:06AM -0700 Matthias Kaehlcke ha dit: > Hi, > > There has been discussion spread over different threads on how to deal > with 'unused-function' warnings raised by clang on static inline > functions. gcc in general does not emit warnings for unused static > inline func

[RFC] clang: 'unused-function' warning on static inline functions

2017-05-30 Thread Matthias Kaehlcke
Hi, There has been discussion spread over different threads on how to deal with 'unused-function' warnings raised by clang on static inline functions. gcc in general does not emit warnings for unused static inline functions, clang does if the function is in a .c file. When building the kernel wit