linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] x86/kprobes: functions should not be declared extern
@ 2021-05-31  3:10 Qiheng Lin
  2021-05-31 10:39 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Qiheng Lin @ 2021-05-31  3:10 UTC (permalink / raw)
  To: tglx, mingo, bp, x86, hpa; +Cc: linux-kernel, Qiheng Lin

The function declaration in kprobes.h is already marked extern, thus its
definition should not have the keyword.

This quiets the following sparse warning:
 function 'arch_unoptimize_kprobes' with external linkage has definition

Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
---
 arch/x86/kernel/kprobes/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
index 71425ebba98a..7d962c884505 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -539,8 +539,8 @@ void arch_unoptimize_kprobe(struct optimized_kprobe *op)
  * Recover original instructions and breakpoints from relative jumps.
  * Caller must call with locking kprobe_mutex.
  */
-extern void arch_unoptimize_kprobes(struct list_head *oplist,
-				    struct list_head *done_list)
+void arch_unoptimize_kprobes(struct list_head *oplist,
+			     struct list_head *done_list)
 {
 	struct optimized_kprobe *op, *tmp;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] x86/kprobes: functions should not be declared extern
  2021-05-31  3:10 [PATCH -next] x86/kprobes: functions should not be declared extern Qiheng Lin
@ 2021-05-31 10:39 ` Borislav Petkov
  2021-06-01  6:16   ` Qiheng Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2021-05-31 10:39 UTC (permalink / raw)
  To: Qiheng Lin; +Cc: tglx, mingo, x86, hpa, linux-kernel

> Subject: Re: [PATCH -next] x86/kprobes: functions should not be declared extern

The condensed patch description in the subject line should start with a
uppercase letter and should be written in imperative tone.

Also, the subject is wrong. Hint: "declaration" vs "definition".

On Mon, May 31, 2021 at 11:10:09AM +0800, Qiheng Lin wrote:
> The function declaration in kprobes.h is already marked extern, thus its
> definition should not have the keyword.
>
> This quiets the following sparse warning:
>  function 'arch_unoptimize_kprobes' with external linkage has definition

This sounds like you're fixing something just because some tool
complains and not because there's a real problem you're fixing.

Please rewrite your commit messages to state what the problem is and
why you're fixing that problem. The tool output can be used to say
something along the lines of "this problem was caught by this tool" but
not as "see, tool X complains and creates a warning and I must fix that
warning immediately."

Ok?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] x86/kprobes: functions should not be declared extern
  2021-05-31 10:39 ` Borislav Petkov
@ 2021-06-01  6:16   ` Qiheng Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Qiheng Lin @ 2021-06-01  6:16 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: tglx, mingo, x86, hpa, linux-kernel

在 2021/5/31 18:39, Borislav Petkov 写道:
>> Subject: Re: [PATCH -next] x86/kprobes: functions should not be declared extern
> 
> The condensed patch description in the subject line should start with a
> uppercase letter and should be written in imperative tone.
> 
> Also, the subject is wrong. Hint: "declaration" vs "definition".
> 
> On Mon, May 31, 2021 at 11:10:09AM +0800, Qiheng Lin wrote:
>> The function declaration in kprobes.h is already marked extern, thus its
>> definition should not have the keyword.
>>
>> This quiets the following sparse warning:
>>   function 'arch_unoptimize_kprobes' with external linkage has definition
> 
> This sounds like you're fixing something just because some tool
> complains and not because there's a real problem you're fixing.
> 
> Please rewrite your commit messages to state what the problem is and
> why you're fixing that problem. The tool output can be used to say
> something along the lines of "this problem was caught by this tool" but
> not as "see, tool X complains and creates a warning and I must fix that
> warning immediately."

Thank you for the review. I will send the v2.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-01  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31  3:10 [PATCH -next] x86/kprobes: functions should not be declared extern Qiheng Lin
2021-05-31 10:39 ` Borislav Petkov
2021-06-01  6:16   ` Qiheng Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).