Skip to contentSkip to conversation

x86/kprobes: Fix old-style-declaration warning

PATCH Applied 'Wei Yongjun 3 participants 3 messages Mar 24, 2021 – Mar 25, 2021

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

PATCH 1/1 x86/kprobes: Fix old-style-declaration warning

From: Wei Yongjun <[email protected]>

Gcc reports build warning as follows:

arch/x86/kernel/kprobes/core.c:940:1:
warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
940 | static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)

      | ^~~~~~

This commit fix it by moving nokprobe_inline to the beginning of declaration.

---
 arch/x86/kernel/kprobes/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/core.c +1 -1
index 89d9f26785c7..5abf251f12ec 100644
@@ -937,7 +937,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
 }
 NOKPROBE_SYMBOL(reenter_kprobe);
 
-static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)
+static nokprobe_inline int kprobe_is_ss(struct kprobe_ctlblk *kcb)
 {
 	return (kcb->kprobe_status == KPROBE_HIT_SS ||
 		kcb->kprobe_status == KPROBE_REENTER);
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Wed, 24 Mar 2021 14:45:02 +0000 'Wei Yongjun <[email protected]> wrote:

From: Wei Yongjun <[email protected]>

Gcc reports build warning as follows:

Quoted 8 lines

arch/x86/kernel/kprobes/core.c:940:1:
warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
940 | static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)

      | ^~~~~~

This commit fix it by moving nokprobe_inline to the beginning of declaration.

Thank you!

Quoted 20 lines
---
 arch/x86/kernel/kprobes/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/core.c +1 -1
index 89d9f26785c7..5abf251f12ec 100644
@@ -937,7 +937,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
 }
 NOKPROBE_SYMBOL(reenter_kprobe);
 
-static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)
+static nokprobe_inline int kprobe_is_ss(struct kprobe_ctlblk *kcb)
 {
 	return (kcb->kprobe_status == KPROBE_HIT_SS ||
 		kcb->kprobe_status == KPROBE_REENTER);
Signature · 1 line
Masami Hiramatsu <[email protected]>
merge bot Applied
#2 lore raw

[tip: x86/core] x86/kprobes: Move 'inline' to the beginning of the kprobe_is_ss() declaration

In reply to 'Wei Yongjun
The following commit has been merged into the x86/core branch of tip:

The following commit has been merged into the x86/core branch of tip:

Commit-ID:     2304d14db6595bea5292bece06c4c625b12d8f89
Gitweb:        https://git.kernel.org/tip/2304d14db6595bea5292bece06c4c625b12d8f89
Author:        Wei Yongjun <[email protected]>
AuthorDate:    Wed, 24 Mar 2021 14:45:02 
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Thu, 25 Mar 2021 13:07:58 +01:00

x86/kprobes: Move 'inline' to the beginning of the kprobe_is_ss() declaration

Address this GCC warning:

arch/x86/kernel/kprobes/core.c:940:1:
warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
940 | static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)
| ^~~~~~

[ mingo: Tidied up the changelog. ]

Fixes 6256e668b7af: ("x86/kprobes: Use int3 instead of debug trap for single-step")
---
 arch/x86/kernel/kprobes/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kprobes/core.c +1 -1
index 922a6e2..dd09021 100644
@@ -940,7 +940,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
 }
 NOKPROBE_SYMBOL(reenter_kprobe);
 
-static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)
+static nokprobe_inline int kprobe_is_ss(struct kprobe_ctlblk *kcb)
 {
 	return (kcb->kprobe_status == KPROBE_HIT_SS ||
 		kcb->kprobe_status == KPROBE_REENTER);