All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Shuah Khan <shuah@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/4] ftrace: Simplify glob handling in unregister_ftrace_function_probe_func()
Date: Mon, 15 May 2017 13:22:10 -0400	[thread overview]
Message-ID: <20170515132210.5efab11c@gandalf.local.home> (raw)
In-Reply-To: <95a1ae9c5dc472fa8b23c0f2ce0ad8276f35d30e.1494702964.git.naveen.n.rao@linux.vnet.ibm.com>

On Sun, 14 May 2017 01:01:01 +0530
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:

> Handle a NULL glob properly.
> 
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
>  kernel/trace/ftrace.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 39dca4e86a94..28dc824ad072 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -4144,9 +4144,9 @@ unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr,
>  	int i, ret = -ENODEV;
>  	int size;
>  
> -	if (glob && (strcmp(glob, "*") == 0 || !strlen(glob)))
> +	if (!glob || (glob && (strcmp(glob, "*") == 0 || !strlen(glob))))

Actually, this can also be simplified.

	if (!glob || strcmp(glob, "*") == 0) || !strlen(glob))

No need to check if glob exists past the first expression.

-- Steve

>  		func_g.search = NULL;
> -	else if (glob) {
> +	else {
>  		int not;
>  
>  		func_g.type = filter_parse_regex(glob, strlen(glob),

  reply	other threads:[~2017-05-15 17:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 19:31 [PATCH 0/4] ftrace: Fix a few issues Naveen N. Rao
2017-05-13 19:31 ` [PATCH 1/4] ftrace: Simplify glob handling in unregister_ftrace_function_probe_func() Naveen N. Rao
2017-05-15 17:22   ` Steven Rostedt [this message]
2017-05-16  8:07     ` Naveen N. Rao
2017-05-13 19:31 ` [PATCH 2/4] ftrace/instances: Clear function triggers when removing instances Naveen N. Rao
2017-05-15 15:21   ` Steven Rostedt
2017-05-15 16:11     ` Steven Rostedt
2017-05-16 16:11       ` Masami Hiramatsu
2017-05-16  2:20   ` Steven Rostedt
2017-05-16 14:01     ` Naveen N. Rao
2017-05-16 17:44       ` Naveen N. Rao
2017-05-16 18:33         ` Steven Rostedt
2017-06-06 17:06           ` Shuah Khan
2017-06-06 17:37             ` Naveen N. Rao
2017-05-13 19:31 ` [PATCH 3/4] selftests/ftrace: Fix bashisms Naveen N. Rao
2017-05-15 15:16   ` Steven Rostedt
2017-05-16 14:25     ` Masami Hiramatsu
2017-05-13 19:31 ` [PATCH 4/4] selftests/ftrace: Add test to remove instance with active event triggers Naveen N. Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170515132210.5efab11c@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.