Skip to contentSkip to conversation

linux-next: ftrace tree build warnings

PATCH New Stephen Rothwell 4 participants 6 messages Nov 25, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next build (x86_64 allmodconfig) produced lots of these warnings:

include/linux/tty.h:330: warning: '______f' is static but declared in inline function 'tty_kref_get' which is not static

Caused by commit 2bcd521a684cc94befbe2ce7d5b613c841b0d304 ("trace:
profile all if conditionals"). Something needs to be done about this ... maybe tty_kref_get needs to be "static inline" instead of "extern inline"?

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Hi all,

Today's linux-next build (x86_64 allmodconfig) produced lots of these warnings:

Quoted 7 lines

include/linux/tty.h:330: warning: '______f' is static but declared in inline function 'tty_kref_get' which is not static

Caused by commit 2bcd521a684cc94befbe2ce7d5b613c841b0d304 ("trace:
profile all if conditionals"). Something needs to be done about this ... maybe tty_kref_get needs to be "static inline" instead of "extern inline"?

Is there a way to suppress this warning here? Since we are only profiling, if it complies fine, then it should not be an issue.

Looking at the uses of this function, is there any reason that it is not "static inline"?

-- Steve

#2 lore raw
In reply to Stephen Rothwell
Quoted 11 lines · Stephen Rothwell

Hi all,

Today's linux-next build (x86_64 allmodconfig) produced lots of these warnings:

include/linux/tty.h:330: warning: '______f' is static but declared in inline function 'tty_kref_get' which is not static

Caused by commit 2bcd521a684cc94befbe2ce7d5b613c841b0d304 ("trace:
profile all if conditionals"). Something needs to be done about this ... maybe tty_kref_get needs to be "static inline" instead of "extern inline"?

i've queued up the fix below, and pushed out a new ftrace-next tree.

Thanks,

Ingo

------------------>
From 14bfc987e395797dfe03e915e8b4c7fc9e5078e4 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Tue, 25 Nov 2008 08:58:11 +0100
Subject: [PATCH] tracing, tty: fix warnings caused by branch tracing and tty_kref_get()
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Stephen Rothwell reported tht this warning started triggering in linux-next:

In file included from init/main.c:27:
include/linux/tty.h: In function ‘tty_kref_get’:
include/linux/tty.h:330: warning: ‘______f’ is static but declared in inline function ‘tty_kref_get’ which is not static

Which gcc emits for 'extern inline' functions that nevertheless define static variables. Change it to 'static inline', which is the norm in the kernel anyway.

---
 include/linux/tty.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/tty.h +1 -1
index 3b8121d..eaec37c 100644
@@ -325,7 +325,7 @@ extern struct class *tty_class;
  *	go away
  */
 
-extern inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
+static inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
 {
 	if (tty)
 		kref_get(&tty->kref);
#3 lore raw

Hi Ingo,

Quoted 2 lines · On Tue, 25 Nov 2008 09:00:35 +0100 Ingo Molnar <[email protected]> wrote:

i've queued up the fix below, and pushed out a new ftrace-next tree.

Thanks.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#4 lore raw
In reply to Stephen Rothwell
Quoted 11 lines · On Tue, 25 Nov 2008 13:38:28 +1100 Stephen Rothwell <[email protected]>…

Hi all,

Today's linux-next build (x86_64 allmodconfig) produced lots of these warnings:

include/linux/tty.h:330: warning: '______f' is static but declared in inline function 'tty_kref_get' which is not static

Caused by commit 2bcd521a684cc94befbe2ce7d5b613c841b0d304 ("trace:
profile all if conditionals"). Something needs to be done about this ... maybe tty_kref_get needs to be "static inline" instead of "extern inline"?

If someone from the ftrace crew can sort the problem out and send me a diff for the ttydev tree that shouldn't be a problem, but really it looks like a problem with ftrace as that can't be the only case this happens surely ?

#5 lore raw

PATCH 1/1 tracing, tty: fix warnings caused by branch tracing and tty_kref_get()

Quoted 15 lines · Alan Cox
Quoted 11 lines · On Tue, 25 Nov 2008 13:38:28 +1100 Stephen Rothwell <[email protected]>…

Hi all,

Today's linux-next build (x86_64 allmodconfig) produced lots of these warnings:

include/linux/tty.h:330: warning: '______f' is static but declared in inline function 'tty_kref_get' which is not static

Caused by commit 2bcd521a684cc94befbe2ce7d5b613c841b0d304 ("trace:
profile all if conditionals"). Something needs to be done about this ... maybe tty_kref_get needs to be "static inline" instead of "extern inline"?

Quoted 4 lines

If someone from the ftrace crew can sort the problem out and send me a diff for the ttydev tree that shouldn't be a problem, but really it looks like a problem with ftrace as that can't be the only case this happens surely ?

i've done quite wide build testing of it and tty.h seems to be the only affected file triggering a warning due to this. ('extern inline' has been eliminated from most of the kernel in recent cycles)

Ingo

---------------->
From 14bfc987e395797dfe03e915e8b4c7fc9e5078e4 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Tue, 25 Nov 2008 08:58:11 +0100
Subject: [PATCH] tracing, tty: fix warnings caused by branch tracing and tty_kref_get()
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Stephen Rothwell reported tht this warning started triggering in linux-next:

In file included from init/main.c:27:
include/linux/tty.h: In function ‘tty_kref_get’:
include/linux/tty.h:330: warning: ‘______f’ is static but declared in inline function ‘tty_kref_get’ which is not static

Which gcc emits for 'extern inline' functions that nevertheless define static variables. Change it to 'static inline', which is the norm in the kernel anyway.

---
 include/linux/tty.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/tty.h +1 -1
index 3b8121d..eaec37c 100644
@@ -325,7 +325,7 @@ extern struct class *tty_class;
  *	go away
  */
 
-extern inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
+static inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
 {
 	if (tty)
 		kref_get(&tty->kref);