ftrace: Remove redundant strsep in mod_callback
By now there isn't any subcommand for mod. Before: sh$ echo '*:mod:ipv6:a' > set_ftrace_filter sh$ echo '*:mod:ipv6' > set_ftrace_filter had the same results, but now first will result in: sh$ echo '*:mod:ipv6:a' > set_ftrace_filter -bash: echo: write error: Invalid argument Also, I clarified ftrace_mod_callback code a little. Link: http://lkml.kernel.org/r/1443545176-3215-1-git-send-email-0x7f454c46@gmail.com Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> [ converted 'if (ret == 0)' to 'if (!ret)' ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
6db0290322
commit
5e3949f0ac
1 changed files with 5 additions and 10 deletions
|
@ -3569,8 +3569,7 @@ static int
|
||||||
ftrace_mod_callback(struct ftrace_hash *hash,
|
ftrace_mod_callback(struct ftrace_hash *hash,
|
||||||
char *func, char *cmd, char *param, int enable)
|
char *func, char *cmd, char *param, int enable)
|
||||||
{
|
{
|
||||||
char *mod;
|
int ret;
|
||||||
int ret = -EINVAL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cmd == 'mod' because we only registered this func
|
* cmd == 'mod' because we only registered this func
|
||||||
|
@ -3581,16 +3580,12 @@ ftrace_mod_callback(struct ftrace_hash *hash,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* we must have a module name */
|
/* we must have a module name */
|
||||||
if (!param)
|
if (!param || !strlen(param))
|
||||||
return ret;
|
return -EINVAL;
|
||||||
|
|
||||||
mod = strsep(¶m, ":");
|
ret = ftrace_match_module_records(hash, func, param);
|
||||||
if (!strlen(mod))
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = ftrace_match_module_records(hash, func, mod);
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue