History

params: replace printk(KERN_<LVL>...) with pr_<lvl>(...)

I left 1 printk which uses __FILE__, __LINE__ explicitly, which should not be subject to generic preferences expressed via pr_fmt(). + tweaks suggested by Joe Perches: - add doing to irq-enabled warning, like others. It wont happen often.. - change sysfs failure crit, not just err, make it 1 line in logs. - coalese 2 format fragments into 1 >80 char line

Jim Cromie committed 14 years ago

Commit b5f3abf1 parent 04db6e51 file · +12 −21Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/params.c+12−21
@@ -201,25 +201,22 @@ int parse_args(const char *doing, · 200 unmodified lines
201201 irq_was_disabled = irqs_disabled();
202202 ret = parse_one(param, val, doing, params, num,
203203 min_level, max_level, unknown);
204− if (irq_was_disabled && !irqs_disabled()) {
205− printk(KERN_WARNING "parse_args(): option '%s' enabled "
206− "irq's!\n", param);
207− }
204+ if (irq_was_disabled && !irqs_disabled())
205+ pr_warn("%s: option '%s' enabled irq's!\n",
206+ doing, param);
207+
208208 switch (ret) {
209209 case -ENOENT:
210− printk(KERN_ERR "%s: Unknown parameter `%s'\n",
211− doing, param);
210+ pr_err("%s: Unknown parameter `%s'\n", doing, param);
212211 return ret;
213212 case -ENOSPC:
214− printk(KERN_ERR
215− "%s: `%s' too large for parameter `%s'\n",
213+ pr_err("%s: `%s' too large for parameter `%s'\n",
216214 doing, val ?: "", param);
217215 return ret;
218216 case 0:
219217 break;
220218 default:
221− printk(KERN_ERR
222− "%s: `%s' invalid for parameter `%s'\n",
219+ pr_err("%s: `%s' invalid for parameter `%s'\n",
223220 doing, val ?: "", param);
224221 return ret;
225222 }
@@ -266,8 +263,7 @@ STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, strict_strtoul); · 40 unmodified lines
266263 int param_set_charp(const char *val, const struct kernel_param *kp)
267264 {
268265 if (strlen(val) > 1024) {
269− printk(KERN_ERR "%s: string parameter too long\n",
270− kp->name);
266+ pr_err("%s: string parameter too long\n", kp->name);
271267 return -ENOSPC;
272268 }
273269
@@ -403,8 +399,7 @@ static int param_array(const char *name, · 129 unmodified lines
403399 int len;
404400
405401 if (*num == max) {
406− printk(KERN_ERR "%s: can only take %i arguments\n",
407− name, max);
402+ pr_err("%s: can only take %i arguments\n", name, max);
408403 return -EINVAL;
409404 }
410405 len = strcspn(val, ",");
@@ -423,8 +418,7 @@ static int param_array(const char *name, · 12 unmodified lines
423418 } while (save == ',');
424419
425420 if (*num < min) {
426− printk(KERN_ERR "%s: needs at least %i arguments\n",
427− name, min);
421+ pr_err("%s: needs at least %i arguments\n", name, min);
428422 return -EINVAL;
429423 }
430424 return 0;
@@ -483,7 +477,7 @@ int param_set_copystring(const char *val, const struct kernel_param *kp) · 52 unmodified lines
483477 const struct kparam_string *kps = kp->str;
484478
485479 if (strlen(val)+1 > kps->maxlen) {
486− printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
480+ pr_err("%s: string doesn't fit in %u chars.\n",
487481 kp->name, kps->maxlen-1);
488482 return -ENOSPC;
489483 }
@@ -753,11 +747,8 @@ static struct module_kobject * __init locate_module_kobject(const char *name) · 263 unmodified lines
753747 #endif
754748 if (err) {
755749 kobject_put(&mk->kobj);
756− printk(KERN_ERR
757− "Module '%s' failed add to sysfs, error number %d\n",
750+ pr_crit("Adding module '%s' to sysfs failed (%d), the system may be unstable.\n",
758751 name, err);
759− printk(KERN_ERR
760− "The system will be unstable now.\n");
761752 return NULL;
762753 }
763754

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t