Commit b5f3abf9 authored by Jim Cromie's avatar Jim Cromie Committed by Greg Kroah-Hartman

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

cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04db6e5f
...@@ -201,25 +201,22 @@ int parse_args(const char *doing, ...@@ -201,25 +201,22 @@ int parse_args(const char *doing,
irq_was_disabled = irqs_disabled(); irq_was_disabled = irqs_disabled();
ret = parse_one(param, val, doing, params, num, ret = parse_one(param, val, doing, params, num,
min_level, max_level, unknown); min_level, max_level, unknown);
if (irq_was_disabled && !irqs_disabled()) { if (irq_was_disabled && !irqs_disabled())
printk(KERN_WARNING "parse_args(): option '%s' enabled " pr_warn("%s: option '%s' enabled irq's!\n",
"irq's!\n", param); doing, param);
}
switch (ret) { switch (ret) {
case -ENOENT: case -ENOENT:
printk(KERN_ERR "%s: Unknown parameter `%s'\n", pr_err("%s: Unknown parameter `%s'\n", doing, param);
doing, param);
return ret; return ret;
case -ENOSPC: case -ENOSPC:
printk(KERN_ERR pr_err("%s: `%s' too large for parameter `%s'\n",
"%s: `%s' too large for parameter `%s'\n",
doing, val ?: "", param); doing, val ?: "", param);
return ret; return ret;
case 0: case 0:
break; break;
default: default:
printk(KERN_ERR pr_err("%s: `%s' invalid for parameter `%s'\n",
"%s: `%s' invalid for parameter `%s'\n",
doing, val ?: "", param); doing, val ?: "", param);
return ret; return ret;
} }
...@@ -266,8 +263,7 @@ STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, strict_strtoul); ...@@ -266,8 +263,7 @@ STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, strict_strtoul);
int param_set_charp(const char *val, const struct kernel_param *kp) int param_set_charp(const char *val, const struct kernel_param *kp)
{ {
if (strlen(val) > 1024) { if (strlen(val) > 1024) {
printk(KERN_ERR "%s: string parameter too long\n", pr_err("%s: string parameter too long\n", kp->name);
kp->name);
return -ENOSPC; return -ENOSPC;
} }
...@@ -403,8 +399,7 @@ static int param_array(const char *name, ...@@ -403,8 +399,7 @@ static int param_array(const char *name,
int len; int len;
if (*num == max) { if (*num == max) {
printk(KERN_ERR "%s: can only take %i arguments\n", pr_err("%s: can only take %i arguments\n", name, max);
name, max);
return -EINVAL; return -EINVAL;
} }
len = strcspn(val, ","); len = strcspn(val, ",");
...@@ -423,8 +418,7 @@ static int param_array(const char *name, ...@@ -423,8 +418,7 @@ static int param_array(const char *name,
} while (save == ','); } while (save == ',');
if (*num < min) { if (*num < min) {
printk(KERN_ERR "%s: needs at least %i arguments\n", pr_err("%s: needs at least %i arguments\n", name, min);
name, min);
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
...@@ -483,7 +477,7 @@ int param_set_copystring(const char *val, const struct kernel_param *kp) ...@@ -483,7 +477,7 @@ int param_set_copystring(const char *val, const struct kernel_param *kp)
const struct kparam_string *kps = kp->str; const struct kparam_string *kps = kp->str;
if (strlen(val)+1 > kps->maxlen) { if (strlen(val)+1 > kps->maxlen) {
printk(KERN_ERR "%s: string doesn't fit in %u chars.\n", pr_err("%s: string doesn't fit in %u chars.\n",
kp->name, kps->maxlen-1); kp->name, kps->maxlen-1);
return -ENOSPC; return -ENOSPC;
} }
...@@ -753,11 +747,8 @@ static struct module_kobject * __init locate_module_kobject(const char *name) ...@@ -753,11 +747,8 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
#endif #endif
if (err) { if (err) {
kobject_put(&mk->kobj); kobject_put(&mk->kobj);
printk(KERN_ERR pr_crit("Adding module '%s' to sysfs failed (%d), the system may be unstable.\n",
"Module '%s' failed add to sysfs, error number %d\n",
name, err); name, err);
printk(KERN_ERR
"The system will be unstable now.\n");
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment