linux-safety.lists.elisa.tech archive mirror
 help / color / mirror / Atom feed
* [linux-safety] [PATCH] kernel: trace: Remove deadstore in trace_uprobe.c
       [not found] <devel@driverdev.osuosl.org, rostedt@goodmis.org, mingo@redhat.com, gregkh@linuxfoundation.org>
@ 2020-12-09 13:16 ` Milan Lakhani
  2020-12-10  5:47   ` Lukas Bulwahn
  0 siblings, 1 reply; 3+ messages in thread
From: Milan Lakhani @ 2020-12-09 13:16 UTC (permalink / raw)
  To: linux-kernel, linux-safety; +Cc: Milan Lakhani

In trace_uprobe.c, trace_uprobe_create assigns ret to 0 but then never
uses this value.

Signed-off-by: Milan Lakhani <milan.lakhani@codethink.co.uk>
---
 kernel/trace/trace_uprobe.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 3cf7128..c7c7070 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -541,7 +541,6 @@ static int trace_uprobe_create(int argc, const char **argv)
 	bool is_return = false;
 	int i, ret;
 
-	ret = 0;
 	ref_ctr_offset = 0;
 
 	switch (argv[0][0]) {
-- 
2.7.4



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#217): https://lists.elisa.tech/g/linux-safety/message/217
Mute This Topic: https://lists.elisa.tech/mt/78828451/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [linux-safety] [PATCH] kernel: trace: Remove deadstore in trace_uprobe.c
  2020-12-09 13:16 ` [linux-safety] [PATCH] kernel: trace: Remove deadstore in trace_uprobe.c Milan Lakhani
@ 2020-12-10  5:47   ` Lukas Bulwahn
  2020-12-10 11:29     ` Milan Lakhani
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Bulwahn @ 2020-12-10  5:47 UTC (permalink / raw)
  To: Milan Lakhani; +Cc: Linux Kernel Mailing List, linux-safety

On Wed, Dec 9, 2020 at 2:17 PM Milan Lakhani
<milan.lakhani@codethink.co.uk> wrote:
>
> In trace_uprobe.c, trace_uprobe_create assigns ret to 0 but then never
> uses this value.
>

Milan, the patch makes sense, but I fear you did not run
./scripts/get_maintainers.pl because you did not include any specific
maintainer as recipient.

The patch subject could be: remove unneeded initialization (instead of
the very generic "dead store" term).

It is also interesting to see who added this initialization; was it
unneeded since the existence of this function, did it become obsolete
at some point in time due to refactoring?

Run ./scripts/get_maintainers.pl  and please CC: me; then you will get
your Reviewed-by: tag.

Lukas

> Signed-off-by: Milan Lakhani <milan.lakhani@codethink.co.uk>
> ---
>  kernel/trace/trace_uprobe.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
> index 3cf7128..c7c7070 100644
> --- a/kernel/trace/trace_uprobe.c
> +++ b/kernel/trace/trace_uprobe.c
> @@ -541,7 +541,6 @@ static int trace_uprobe_create(int argc, const char **argv)
>         bool is_return = false;
>         int i, ret;
>
> -       ret = 0;
>         ref_ctr_offset = 0;
>
>         switch (argv[0][0]) {
> --
> 2.7.4
>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#218): https://lists.elisa.tech/g/linux-safety/message/218
Mute This Topic: https://lists.elisa.tech/mt/78828451/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [linux-safety] [PATCH] kernel: trace: Remove deadstore in trace_uprobe.c
  2020-12-10  5:47   ` Lukas Bulwahn
@ 2020-12-10 11:29     ` Milan Lakhani
  0 siblings, 0 replies; 3+ messages in thread
From: Milan Lakhani @ 2020-12-10 11:29 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: Linux Kernel Mailing List, linux-safety


On 10/12/2020 05:47, Lukas Bulwahn wrote:
> On Wed, Dec 9, 2020 at 2:17 PM Milan Lakhani
> <milan.lakhani@codethink.co.uk> wrote:
>> In trace_uprobe.c, trace_uprobe_create assigns ret to 0 but then never
>> uses this value.
>>
> Milan, the patch makes sense, but I fear you did not run
> ./scripts/get_maintainers.pl because you did not include any specific
> maintainer as recipient.

So I did actually run get_maintainers.pl but somehow in my text editor 
where I had pasted the e-mail addresses they had got onto two separate 
lines, and git send-email must have only taken the first line. I'll have 
to get the e-mails right first time next time, to move onto checking 
documentation!

> The patch subject could be: remove unneeded initialization (instead of
> the very generic "dead store" term).
Updated this, thanks
>
> It is also interesting to see who added this initialization; was it
> unneeded since the existence of this function, did it become obsolete
> at some point in time due to refactoring?

The line was unneeded since the function was created in 2012 by Srikar 
Dronamraju in f3f096cfe, there have actually somehow been six commits to 
the lines between the initial assignment and reassignment of ret but 
they have all left the unnecessary initialization there!

>
> Run ./scripts/get_maintainers.pl  and please CC: me; then you will get
> your Reviewed-by: tag.
>
> Lukas
>
>> Signed-off-by: Milan Lakhani <milan.lakhani@codethink.co.uk>
>> ---
>>   kernel/trace/trace_uprobe.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
>> index 3cf7128..c7c7070 100644
>> --- a/kernel/trace/trace_uprobe.c
>> +++ b/kernel/trace/trace_uprobe.c
>> @@ -541,7 +541,6 @@ static int trace_uprobe_create(int argc, const char **argv)
>>          bool is_return = false;
>>          int i, ret;
>>
>> -       ret = 0;
>>          ref_ctr_offset = 0;
>>
>>          switch (argv[0][0]) {
>> --
>> 2.7.4
>>


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#220): https://lists.elisa.tech/g/linux-safety/message/220
Mute This Topic: https://lists.elisa.tech/mt/78828451/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2020-12-10 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <devel@driverdev.osuosl.org, rostedt@goodmis.org, mingo@redhat.com, gregkh@linuxfoundation.org>
2020-12-09 13:16 ` [linux-safety] [PATCH] kernel: trace: Remove deadstore in trace_uprobe.c Milan Lakhani
2020-12-10  5:47   ` Lukas Bulwahn
2020-12-10 11:29     ` Milan Lakhani

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).