lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  7 Oct 2011 14:33:26 -0600
From:	jim.cromie@...il.com
To:	jbaron@...hat.com
Cc:	greg@...ah.com, joe@...ches.com, bart.vanassche@...il.com,
	linux-kernel@...r.kernel.org, Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH 20/26] dynamic_debug: make ddebug_describe_flags more generic

From: Jim Cromie <jim.cromie@...il.com>

Alter fn-sig to accept flags arg directly, instead of a ptr to
structure containing it.  This lets us reuse it for pending-queries.

Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
 lib/dynamic_debug.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 3c9244d..d7b71a6 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -103,7 +103,7 @@ static struct { unsigned flag:8; char opt_char; } opt_array[] = {
 };
 
 /* format a string into buf[] which describes the _ddebug's flags */
-static char *ddebug_describe_flags(struct _ddebug *dp, char *buf,
+static char *ddebug_describe_flags(unsigned int flags, char *buf,
 				    size_t maxlen)
 {
 	char *p = buf;
@@ -112,7 +112,7 @@ static char *ddebug_describe_flags(struct _ddebug *dp, char *buf,
 	BUG_ON(maxlen < 10);
 	*p++ = '=';
 	for (i = 0; i < ARRAY_SIZE(opt_array); ++i)
-		if (dp->flags & opt_array[i].flag)
+		if (flags & opt_array[i].flag)
 			*p++ = opt_array[i].opt_char;
 	if (*(p-1) == '=')
 		*p++ = '_';
@@ -227,7 +227,8 @@ static int ddebug_change(const struct ddebug_query *query,
 				pr_info("changed %s:%d [%s]%s %s\n",
 					trim_prefix(dp->filename), dp->lineno,
 					dt->mod_name, dp->function,
-					ddebug_describe_flags(dp, flagbuf,
+					ddebug_describe_flags(dp->flags,
+							flagbuf,
 							sizeof(flagbuf)));
 		}
 	}
@@ -901,7 +902,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p)
 	seq_printf(m, "%s:%u [%s]%s %s \"",
 		trim_prefix(dp->filename), dp->lineno,
 		iter->table->mod_name, dp->function,
-		ddebug_describe_flags(dp, flagsbuf, sizeof(flagsbuf)));
+		ddebug_describe_flags(dp->flags, flagsbuf, sizeof(flagsbuf)));
 	seq_escape(m, dp->format, "\t\r\n\"");
 	seq_puts(m, "\"\n");
 
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ