[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191029200129.10315-1-jim.cromie@gmail.com>
Date: Tue, 29 Oct 2019 14:01:29 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, linux-kernel@...r.kernel.org
Cc: linux@...musvillemoes.dk, greg@...ah.com,
Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH 14/16] dyndbg: prefer declarative init in caller, to memset in callee
drop memset in ddebug_parse_query, instead initialize the stack
variable in the caller.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
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 c6273fabe52c..4369afeb52f0 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -358,7 +358,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> */
@@ -479,7 +478,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.21.0
Powered by blists - more mailing lists