mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
dyndbg: prefer declarative init in caller, to memset in callee
ddebug_exec_query declares an auto var, and passes it to ddebug_parse_query, which memsets it before using it. Drop that memset, instead initialize the variable in the caller; let the compiler decide how to do it. Acked-by: <jbaron@akamai.com> Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Link: https://lore.kernel.org/r/20200719231058.1586423-10-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0b8f96be9b
commit
9c9d0acbe2
1 changed files with 1 additions and 2 deletions
|
@ -330,7 +330,6 @@ static int ddebug_parse_query(char *words[], int nwords,
|
||||||
pr_err("expecting pairs of match-spec <value>\n");
|
pr_err("expecting pairs of match-spec <value>\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
memset(query, 0, sizeof(*query));
|
|
||||||
|
|
||||||
if (modname)
|
if (modname)
|
||||||
/* support $modname.dyndbg=<multiple queries> */
|
/* support $modname.dyndbg=<multiple queries> */
|
||||||
|
@ -448,7 +447,7 @@ static int ddebug_parse_flags(const char *str, unsigned int *flagsp,
|
||||||
static int ddebug_exec_query(char *query_string, const char *modname)
|
static int ddebug_exec_query(char *query_string, const char *modname)
|
||||||
{
|
{
|
||||||
unsigned int flags = 0, mask = 0;
|
unsigned int flags = 0, mask = 0;
|
||||||
struct ddebug_query query;
|
struct ddebug_query query = {};
|
||||||
#define MAXWORDS 9
|
#define MAXWORDS 9
|
||||||
int nwords, nfound;
|
int nwords, nfound;
|
||||||
char *words[MAXWORDS];
|
char *words[MAXWORDS];
|
||||||
|
|
Loading…
Reference in a new issue