Skip to contentSkip to conversation

perf/core: Move inline keyword at the beginning of declaration

PATCH In review Mathieu Malaterre 3 participants 6 messages Dec 26, 2017 – Jun 27, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 perf/core: Move inline keyword at the beginning of declaration

Fix non-fatal warning:

kernel/events/core.c:6106:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void __always_inline
^~~~~~

---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 4df5b695bf0d..aa874d2b58b3 100644
@@ -6103,7 +6103,7 @@ void perf_prepare_sample(struct perf_event_header *header,
 		data->phys_addr = perf_virt_to_phys(data->addr);
 }
 
-static void __always_inline
+static __always_inline void
 __perf_event_output(struct perf_event *event,
 		    struct perf_sample_data *data,
 		    struct pt_regs *regs,
Signature · 1 line
2.11.0
#1 lore raw

Em Tue, Dec 26, 2017 at 03:09:13PM +0100, Mathieu Malaterre escreveu:

Quoted 5 lines

Fix non-fatal warning:

kernel/events/core.c:6106:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void __always_inline
^~~~~~

Can you please provide more context? When did this become a problem? What gcc version?

- Arnaldo

Quoted 20 lines
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 4df5b695bf0d..aa874d2b58b3 100644
@@ -6103,7 +6103,7 @@ void perf_prepare_sample(struct perf_event_header *header,
 		data->phys_addr = perf_virt_to_phys(data->addr);
 }
 
-static void __always_inline
+static __always_inline void
 __perf_event_output(struct perf_event *event,
 		    struct perf_sample_data *data,
 		    struct pt_regs *regs,
Signature · 1 line
2.11.0
#2 lore raw

Hi Arnaldo,

Quoted 10 lines · Arnaldo Carvalho de Melo

Em Tue, Dec 26, 2017 at 03:09:13PM +0100, Mathieu Malaterre escreveu:

Quoted 5 lines

Fix non-fatal warning:

kernel/events/core.c:6106:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void __always_inline
^~~~~~

Can you please provide more context? When did this become a problem? What gcc version?

I tend to use W=1 before submitting a patch since not everything is being caught by ./scripts/checkpatch.pl. So this trivial patch was simply a way for me to remove some warning pollution I was seeing on my branch (not clear why this specific warning is considered an error in other section of the linux tree). This is a custom pmac32 branch, gcc version is:

$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516

Feel free to drop it if this is too much noise.

Thanks

Quoted 22 lines

- Arnaldo

Quoted 20 lines
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -2
index 4df5b695bf0d..aa874d2b58b3 100644
@@ -6103,7 +6103,7 @@ void perf_prepare_sample(struct perf_event_header *header,
              data->phys_addr = perf_virt_to_phys(data->addr);
 }
 
-static void __always_inline
+static __always_inline void
 __perf_event_output(struct perf_event *event,
                  struct perf_sample_data *data,
                  struct pt_regs *regs,
--

2.11.0

#3 lore raw

Em Tue, Dec 26, 2017 at 07:23:08PM +0100, Mathieu Malaterre escreveu:

Quoted 21 lines

Hi Arnaldo,

Quoted 9 lines · Arnaldo Carvalho de Melo

Em Tue, Dec 26, 2017 at 03:09:13PM +0100, Mathieu Malaterre escreveu:

Quoted 5 lines

Fix non-fatal warning:

kernel/events/core.c:6106:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void __always_inline
^~~~~~

Can you please provide more context? When did this become a problem? What gcc version?

I tend to use W=1 before submitting a patch since not everything is being caught by ./scripts/checkpatch.pl. So this trivial patch was simply a way for me to remove some warning pollution I was seeing on my branch (not clear why this specific warning is considered an error in other section of the linux tree). This is a custom pmac32 branch, gcc version is:

Quoted 4 lines
$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516

Feel free to drop it if this is too much noise.

Nah, I just like to have enough info on the cset as to where is that the problem takes place, which you now have provided and I'll add to the cset, thanks!

- Arnaldo

Quoted 24 lines

Thanks

Quoted 22 lines

- Arnaldo

Quoted 20 lines
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -2
index 4df5b695bf0d..aa874d2b58b3 100644
@@ -6103,7 +6103,7 @@ void perf_prepare_sample(struct perf_event_header *header,
              data->phys_addr = perf_virt_to_phys(data->addr);
 }
 
-static void __always_inline
+static __always_inline void
 __perf_event_output(struct perf_event *event,
                  struct perf_sample_data *data,
                  struct pt_regs *regs,
--

2.11.0

#4 lore raw

PATCH v2 1/1 perf/core: Move inline keyword at the beginning of declaration

In reply to Mathieu Malaterre

Fix non-fatal warning triggered during compilation with W=1:

kernel/events/core.c:6106:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void __always_inline
^~~~~~

---
v2: Explicit reference to W=1

 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 80cca2b30c4f..8f0434a9951a 100644
@@ -6482,7 +6482,7 @@ void perf_prepare_sample(struct perf_event_header *header,
 		data->phys_addr = perf_virt_to_phys(data->addr);
 }
 
-static void __always_inline
+static __always_inline void
 __perf_event_output(struct perf_event *event,
 		    struct perf_sample_data *data,
 		    struct pt_regs *regs,
Signature · 1 line
2.11.0
#5 lore raw
perf/core: Move inline keyword at the beginning of declaration
Commit-ID:  9331510135640429711afbd0c810686100824a79
Gitweb:     https://git.kernel.org/tip/9331510135640429711afbd0c810686100824a79
Author:     Mathieu Malaterre <[email protected]>
AuthorDate: Tue, 26 Jun 2018 22:23:00 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 27 Jun 2018 09:55:58 +0200

perf/core: Move inline keyword at the beginning of declaration

Fix non-fatal warning triggered during compilation with W=1:

kernel/events/core.c:6106:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
static void __always_inline
^~~~~~

Cc Alexander Shishkin <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 80cca2b30c4f..8f0434a9951a 100644
@@ -6482,7 +6482,7 @@ void perf_prepare_sample(struct perf_event_header *header,
 		data->phys_addr = perf_virt_to_phys(data->addr);
 }
 
-static void __always_inline
+static __always_inline void
 __perf_event_output(struct perf_event *event,
 		    struct perf_sample_data *data,
 		    struct pt_regs *regs,