Skip to content

Commit

Permalink
kernel/params: replace DEBUGP with pr_debug
Browse files Browse the repository at this point in the history
Use more flexible pr_debug.  This allows:

  echo "module params +p" > /dbg/dynamic_debug/control

to turn on debug messages when needed.

Signed-off-by: Jim Cromie <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
jimc authored and rustyrussell committed Jan 12, 2012
1 parent 5e12416 commit 8487bfd
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
#include <linux/slab.h>
#include <linux/ctype.h>

#if 0
#define DEBUGP printk
#else
#define DEBUGP(fmt, a...)
#endif

/* Protects all parameters, and incidentally kmalloced_param list. */
static DEFINE_MUTEX(param_lock);

Expand Down Expand Up @@ -105,7 +99,7 @@ static int parse_one(char *param,
/* No one handled NULL, so do it here. */
if (!val && params[i].ops->set != param_set_bool)
return -EINVAL;
DEBUGP("They are equal! Calling %p\n",
pr_debug("They are equal! Calling %p\n",
params[i].ops->set);
mutex_lock(&param_lock);
err = params[i].ops->set(val, &params[i]);
Expand All @@ -115,11 +109,11 @@ static int parse_one(char *param,
}

if (handle_unknown) {
DEBUGP("Unknown argument: calling %p\n", handle_unknown);
pr_debug("Unknown argument: calling %p\n", handle_unknown);
return handle_unknown(param, val);
}

DEBUGP("Unknown argument `%s'\n", param);
pr_debug("Unknown argument `%s'\n", param);
return -ENOENT;
}

Expand Down Expand Up @@ -184,7 +178,7 @@ int parse_args(const char *name,
{
char *param, *val;

DEBUGP("Parsing ARGS: %s\n", args);
pr_debug("Parsing ARGS: %s\n", args);

/* Chew leading spaces */
args = skip_spaces(args);
Expand Down

0 comments on commit 8487bfd

Please sign in to comment.