Skip to contentSkip to conversation

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

PATCH In review Mathieu Malaterre 2 participants 6 messages Dec 26, 2017 – Dec 29, 2017 perf events

lore
Share & tools
lore
#0 lore raw

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

Fix non-fatal warnings such as:

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

---
 kernel/events/ring_buffer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/events/ring_buffer.c +3 -3
index 141aa2ca8728..c59aba0e7236 100644
@@ -102,7 +102,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle)
 	preempt_enable();
 }
 
-static bool __always_inline
+static __always_inline bool
 ring_buffer_has_space(unsigned long head, unsigned long tail,
 		      unsigned long data_size, unsigned int size,
 		      bool backward)
@@ -113,7 +113,7 @@ ring_buffer_has_space(unsigned long head, unsigned long tail,
 		return CIRC_SPACE(tail, head, data_size) >= size;
 }
 
-static int __always_inline
+static __always_inline int
 __perf_output_begin(struct perf_output_handle *handle,
 		    struct perf_event *event, unsigned int size,
 		    bool backward)
@@ -413,7 +413,7 @@ void *perf_aux_output_begin(struct perf_output_handle *handle,
 }
 EXPORT_SYMBOL_GPL(perf_aux_output_begin);
 
-static bool __always_inline rb_need_aux_wakeup(struct ring_buffer *rb)
+static __always_inline bool rb_need_aux_wakeup(struct ring_buffer *rb)
 {
 	if (rb->aux_overwrite)
 		return false;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 10 lines · Mathieu Malaterre

Fix non-fatal warnings such as:

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

---
 kernel/events/ring_buffer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Hm, never saw this warning before - is this a newly default GCC warning, or some distro CFLAGS build that enables it?

Thanks,

Ingo

#2 lore raw

Hi Ingo,

Quoted 9 lines · Ingo Molnar
Quoted 6 lines · Mathieu Malaterre

Fix non-fatal warnings such as:

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

Quoted 7 lines
Quoted 4 lines
---
 kernel/events/ring_buffer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Hm, never saw this warning before - is this a newly default GCC warning, or some distro CFLAGS build that enables it?

Nope. Just compiling vanilla kernel with default options, defconfig was pmac32. I used W=1.

#3 lore raw
Quoted 17 lines · Mathieu Malaterre

Hi Ingo,

Quoted 14 lines · Ingo Molnar
Quoted 10 lines · Mathieu Malaterre

Fix non-fatal warnings such as:

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

---
 kernel/events/ring_buffer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 5 lines
Quoted 2 lines

Hm, never saw this warning before - is this a newly default GCC warning, or some distro CFLAGS build that enables it?

Nope. Just compiling vanilla kernel with default options, defconfig was pmac32. I used W=1.

"W=1" is not a default build variant - it enables -Wall...

This absolutely needs to be spelled out in the changelog!

Thanks,

Ingo

#4 lore raw
In reply to Mathieu Malaterre

BTW., your email "To:" header is horribly broken, for this and the other patches you sent recently:

To: unlisted-recipients: no To-header on input <;

I manually fixed it up when replying, but please fix.

Thanks,

Ingo

#5 lore raw

Hi again,

Quoted 7 lines · Ingo Molnar

BTW., your email "To:" header is horribly broken, for this and the other patches you sent recently:

To: unlisted-recipients: no To-header on input <;

I manually fixed it up when replying, but please fix.

Right. I copy/pasted a zsh command from the web which seems to be far from perfect:

function kpatch () {
patch=$1
shift

  git send-email \
    --cc-cmd="./scripts/get_maintainer.pl --norolestats $patch" \
    $@ $patch
}

I'll fix that.

Thanks