mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] trace: remove unneeded initialization in __trace_uprobe_create()
@ 2021-12-27 12:53 Lukas Bulwahn
  2022-01-05 23:57 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Bulwahn @ 2021-12-27 12:53 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: kernel-janitors, linux-kernel, Lukas Bulwahn

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 <lukas.bulwahn@gmail.com>
---
 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 5921951a0d5c..9da10c5efdce 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -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]) {
-- 
2.17.1


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

end of thread, other threads:[~2022-01-06  0:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 12:53 [PATCH] trace: remove unneeded initialization in __trace_uprobe_create() Lukas Bulwahn
2022-01-05 23:57 ` Steven Rostedt
2022-01-06  0:47   ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®