[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170516080711.GC3394@naverao1-tp.localdomain>
Date: Tue, 16 May 2017 13:37:11 +0530
From: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Shuah Khan <shuah@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 1/4] ftrace: Simplify glob handling in
unregister_ftrace_function_probe_func()
On 2017/05/15 01:22PM, Steven Rostedt wrote:
> On Sun, 14 May 2017 01:01:01 +0530
> "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com> wrote:
>
> > Handle a NULL glob properly.
> >
> > Signed-off-by: Naveen N. Rao <naveen.n.rao@...ux.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.
:facepalm:
I'll respin. Thanks.
- Naveen
Powered by blists - more mailing lists