Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6b183ed authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware)
Browse files

tracing/kprobe: Remove unneeded extra strchr() from create_trace_kprobe()



By utilizing a temporary variable, we can avoid adding another call to
strchr(). Instead, save the first call to a temp variable, and then use that
variable as the reference to set the event variable.

Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 6bf4ca7f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -749,10 +749,13 @@ static int create_trace_kprobe(int argc, char **argv)
	}

	if (event) {
		if (strchr(event, '/')) {
		char *slash;

		slash = strchr(event, '/');
		if (slash) {
			group = event;
			event = strchr(group, '/') + 1;
			event[-1] = '\0';
			event = slash + 1;
			slash[0] = '\0';
			if (strlen(group) == 0) {
				pr_info("Group name is not specified\n");
				return -EINVAL;