trace: remove unneeded initialization in __trace_uprobe_create()
Subsystems (2)
PATCH 1/1 trace: remove unneeded initialization in __trace_uprobe_create()
There is no need to initialize ret with 0, as all the early error branches simply return constant values, and the default path always reaches ret = kern_path(filename, LOOKUP_FOLLOW, &path), which will reset ret before the initial value was ever used.
Remove this unneeded initialization and keep the code succinct.
--- kernel/trace/trace_uprobe.c | 1 - 1 file changed, 1 deletion(-)
kernel/trace/trace_uprobe.c +0 -1
@@ -548,7 +548,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 ]) {
Signature · 1 line
2.17.1
Steven Rostedt
maintainerMasami, want to ack this?
-- Steve
Quoted 24 lines · On Mon, 27 Dec 2021 13:53:08 +0100 Lukas Bulwahn <[email protected]>…
There is no need to initialize ret with 0, as all the early error branches simply return constant values, and the default path always reaches ret =
kern_path(filename, LOOKUP_FOLLOW, &path), which will reset ret before the initial value was ever used.Remove this unneeded initialization and keep the code succinct.
Signed-off-by Lukas Bulwahn <[email protected]>--- kernel/trace/trace_uprobe.c | 1 - 1 file changed, 1 deletion(-)kernel/trace/trace_uprobe.c +0
-1@@ -548,7 +548,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 ]) {
Quoted 14 lines · On Wed, 5 Jan 2022 18:57:15 -0500 Steven Rostedt <[email protected]> wrote:
Masami, want to ack this?
-- Steve
Quoted 6 lines · On Mon, 27 Dec 2021 13:53:08 +0100 Lukas Bulwahn <[email protected]>…
There is no need to initialize ret with 0, as all the early error branches simply return constant values, and the default path always reaches ret =
kern_path(filename, LOOKUP_FOLLOW, &path), which will reset ret before the initial value was ever used.Remove this unneeded initialization and keep the code succinct.
Thanks, this looks good to me.
Regards,
Quoted 19 lines
Quoted 18 lines
Signed-off-by Lukas Bulwahn <[email protected]>--- kernel/trace/trace_uprobe.c | 1 - 1 file changed, 1 deletion(-)kernel/trace/trace_uprobe.c +0
-1@@ -548,7 +548,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 ]) {
Signature · 1 line
Masami Hiramatsu <[email protected]>