aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2011-12-06 14:11:31 -0500
committerRusty Russell <rusty@rustcorp.com.au>2012-01-12 18:02:15 -0500
commit8487bfd954928660a52e91384a9b1f1049217e35 (patch)
treed6ef4215f934ace1ab8470f260a06d04bac619b7 /kernel/params.c
parent5e12416927975aa3c58394cea15db6c3e488a033 (diff)
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>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 65aae11eb93f..9240664af110 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -25,12 +25,6 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/ctype.h> 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/* Protects all parameters, and incidentally kmalloced_param list. */ 28/* Protects all parameters, and incidentally kmalloced_param list. */
35static DEFINE_MUTEX(param_lock); 29static DEFINE_MUTEX(param_lock);
36 30
@@ -105,7 +99,7 @@ static int parse_one(char *param,
105 /* No one handled NULL, so do it here. */ 99 /* No one handled NULL, so do it here. */
106 if (!val && params[i].ops->set != param_set_bool) 100 if (!val && params[i].ops->set != param_set_bool)
107 return -EINVAL; 101 return -EINVAL;
108 DEBUGP("They are equal! Calling %p\n", 102 pr_debug("They are equal! Calling %p\n",
109 params[i].ops->set); 103 params[i].ops->set);
110 mutex_lock(&param_lock); 104 mutex_lock(&param_lock);
111 err = params[i].ops->set(val, &params[i]); 105 err = params[i].ops->set(val, &params[i]);
@@ -115,11 +109,11 @@ static int parse_one(char *param,
115 } 109 }
116 110
117 if (handle_unknown) { 111 if (handle_unknown) {
118 DEBUGP("Unknown argument: calling %p\n", handle_unknown); 112 pr_debug("Unknown argument: calling %p\n", handle_unknown);
119 return handle_unknown(param, val); 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 return -ENOENT; 117 return -ENOENT;
124} 118}
125 119
@@ -184,7 +178,7 @@ int parse_args(const char *name,
184{ 178{
185 char *param, *val; 179 char *param, *val;
186 180
187 DEBUGP("Parsing ARGS: %s\n", args); 181 pr_debug("Parsing ARGS: %s\n", args);
188 182
189 /* Chew leading spaces */ 183 /* Chew leading spaces */
190 args = skip_spaces(args); 184 args = skip_spaces(args);