Commit 8487bfd954928660a52e91384a9b1f1049217e35

Authored by Jim Cromie
Committed by Rusty Russell
1 parent 5e12416927

kernel/params: replace DEBUGP with pr_debug

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 <jim.cromie@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 1 changed file with 4 additions and 10 deletions Side-by-side Diff

... ... @@ -25,12 +25,6 @@
25 25 #include <linux/slab.h>
26 26 #include <linux/ctype.h>
27 27  
28   -#if 0
29   -#define DEBUGP printk
30   -#else
31   -#define DEBUGP(fmt, a...)
32   -#endif
33   -
34 28 /* Protects all parameters, and incidentally kmalloced_param list. */
35 29 static DEFINE_MUTEX(param_lock);
36 30  
... ... @@ -105,7 +99,7 @@
105 99 /* No one handled NULL, so do it here. */
106 100 if (!val && params[i].ops->set != param_set_bool)
107 101 return -EINVAL;
108   - DEBUGP("They are equal! Calling %p\n",
  102 + pr_debug("They are equal! Calling %p\n",
109 103 params[i].ops->set);
110 104 mutex_lock(&param_lock);
111 105 err = params[i].ops->set(val, &params[i]);
112 106  
... ... @@ -115,11 +109,11 @@
115 109 }
116 110  
117 111 if (handle_unknown) {
118   - DEBUGP("Unknown argument: calling %p\n", handle_unknown);
  112 + pr_debug("Unknown argument: calling %p\n", handle_unknown);
119 113 return handle_unknown(param, val);
120 114 }
121 115  
122   - DEBUGP("Unknown argument `%s'\n", param);
  116 + pr_debug("Unknown argument `%s'\n", param);
123 117 return -ENOENT;
124 118 }
125 119  
... ... @@ -184,7 +178,7 @@
184 178 {
185 179 char *param, *val;
186 180  
187   - DEBUGP("Parsing ARGS: %s\n", args);
  181 + pr_debug("Parsing ARGS: %s\n", args);
188 182  
189 183 /* Chew leading spaces */
190 184 args = skip_spaces(args);