Re: [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-19 Thread Masami Hiramatsu
(2014/11/19 16:08), SF Markus Elfring wrote: >>> index 3995f54..f1e7d45 100644 >>> --- a/kernel/kprobes.c >>> +++ b/kernel/kprobes.c >>> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p) >>> out: >>> mutex_unlock(&kprobe_mutex); >>> >>> - if (probed_mod) >>> - module_pu

Re: [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-18 Thread SF Markus Elfring
>> index 3995f54..f1e7d45 100644 >> --- a/kernel/kprobes.c >> +++ b/kernel/kprobes.c >> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p) >> out: >> mutex_unlock(&kprobe_mutex); >> >> -if (probed_mod) >> -module_put(probed_mod); >> +module_put(probed_mod); > >

Re: [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-17 Thread Masami Hiramatsu
(2014/11/16 21:34), SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 16 Nov 2014 12:20:31 +0100 > > The module_put() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Cocci

Re: [Cocci] [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-16 Thread SF Markus Elfring
> The if around the module_put is helpful to the reader to understand > that this possibility exists. I have got a different opinion. I would still prefer a small code clean-up there. Regards, Markus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a mes

Re: [Cocci] [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-16 Thread Julia Lawall
On Sun, 16 Nov 2014, SF Markus Elfring wrote: > >> diff --git a/kernel/kprobes.c b/kernel/kprobes.c > >> index 3995f54..f1e7d45 100644 > >> --- a/kernel/kprobes.c > >> +++ b/kernel/kprobes.c > >> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p) > >> out: > >>mutex_unlock(&kprobe_mu

Re: [Cocci] [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-16 Thread SF Markus Elfring
>> diff --git a/kernel/kprobes.c b/kernel/kprobes.c >> index 3995f54..f1e7d45 100644 >> --- a/kernel/kprobes.c >> +++ b/kernel/kprobes.c >> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p) >> out: >> mutex_unlock(&kprobe_mutex); >> >> -if (probed_mod) >> -module_put

Re: [Cocci] [PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-16 Thread Julia Lawall
On Sun, 16 Nov 2014, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 16 Nov 2014 12:20:31 +0100 > > The module_put() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Cocci

[PATCH 1/1] kprobes: Deletion of an unnecessary check before the function call "module_put"

2014-11-16 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 16 Nov 2014 12:20:31 +0100 The module_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- kernel