[PATCH 14/16] dyndbg: prefer declarative init in caller, to memset in callee

From: Jim Cromie
Date: Fri Jun 05 2020 - 12:28:21 EST


drop memset in ddebug_parse_query, instead initialize the stack
variable in the caller; let the compiler decide how to do it.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
---
lib/dynamic_debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 90061833ef3f..f0c0c31e91ea 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -372,7 +372,6 @@ static int ddebug_parse_query(char *words[], int nwords,
pr_err("expecting pairs of match-spec <value>\n");
return -EINVAL;
}
- memset(query, 0, sizeof(*query));

if (modname)
/* support $modname.dyndbg=<multiple queries> */
@@ -493,7 +492,7 @@ static int ddebug_exec_query(char *query_string, const char *modname)
{
struct flagsettings mods = {};
struct flagsettings filter = {};
- struct ddebug_query query;
+ struct ddebug_query query = {};
#define MAXWORDS 9
int nwords, nfound;
char *words[MAXWORDS];
--
2.26.2