From: Jim Cromie <jim.cromie@gmail.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Cc: jbaron@redhat.com, Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 2/3] params: replace printk(KERN_<LVL>...) with pr_<lvl>(...)
Date: Thu, 3 May 2012 11:57:38 -0600 [thread overview]
Message-ID: <1336067860-19953-2-git-send-email-jim.cromie@gmail.com> (raw)
In-Reply-To: <1336067860-19953-1-git-send-email-jim.cromie@gmail.com>
I left 1 printk which uses __FILE__, __LINE__ explicitly, which should
not be subject to generic preferences expressed via pr_fmt().
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
kernel/params.c | 33 ++++++++++++---------------------
1 files changed, 12 insertions(+), 21 deletions(-)
diff --git a/kernel/params.c b/kernel/params.c
index be78c90..08414ba 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -201,25 +201,21 @@ int parse_args(const char *doing,
irq_was_disabled = irqs_disabled();
ret = parse_one(param, val, doing, params, num,
min_level, max_level, unknown);
- if (irq_was_disabled && !irqs_disabled()) {
- printk(KERN_WARNING "parse_args(): option '%s' enabled "
- "irq's!\n", param);
- }
+ if (irq_was_disabled && !irqs_disabled())
+ pr_warn("option '%s' enabled irq's!\n", param);
+
switch (ret) {
case -ENOENT:
- printk(KERN_ERR "%s: Unknown parameter `%s'\n",
- doing, param);
+ pr_err("%s: Unknown parameter `%s'\n", doing, param);
return ret;
case -ENOSPC:
- printk(KERN_ERR
- "%s: `%s' too large for parameter `%s'\n",
+ pr_err("%s: `%s' too large for parameter `%s'\n",
doing, val ?: "", param);
return ret;
case 0:
break;
default:
- printk(KERN_ERR
- "%s: `%s' invalid for parameter `%s'\n",
+ pr_err("%s: `%s' invalid for parameter `%s'\n",
doing, val ?: "", param);
return ret;
}
@@ -266,8 +262,7 @@ STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, strict_strtoul);
int param_set_charp(const char *val, const struct kernel_param *kp)
{
if (strlen(val) > 1024) {
- printk(KERN_ERR "%s: string parameter too long\n",
- kp->name);
+ pr_err("%s: string parameter too long\n", kp->name);
return -ENOSPC;
}
@@ -403,8 +398,7 @@ static int param_array(const char *name,
int len;
if (*num == max) {
- printk(KERN_ERR "%s: can only take %i arguments\n",
- name, max);
+ pr_err("%s: can only take %i arguments\n", name, max);
return -EINVAL;
}
len = strcspn(val, ",");
@@ -423,8 +417,7 @@ static int param_array(const char *name,
} while (save == ',');
if (*num < min) {
- printk(KERN_ERR "%s: needs at least %i arguments\n",
- name, min);
+ pr_err("%s: needs at least %i arguments\n", name, min);
return -EINVAL;
}
return 0;
@@ -483,7 +476,7 @@ int param_set_copystring(const char *val, const struct kernel_param *kp)
const struct kparam_string *kps = kp->str;
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);
return -ENOSPC;
}
@@ -753,11 +746,9 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
#endif
if (err) {
kobject_put(&mk->kobj);
- printk(KERN_ERR
- "Module '%s' failed add to sysfs, error number %d\n",
+ pr_err("Module '%s' failed add to sysfs, error: %d\n"
+ "The system will be unstable now.\n",
name, err);
- printk(KERN_ERR
- "The system will be unstable now.\n");
return NULL;
}
--
1.7.8.1
next prev parent reply other threads:[~2012-05-03 17:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 17:57 [PATCH 1/3] params.c: fix Smack complaint about parse_args Jim Cromie
2012-05-03 17:57 ` Jim Cromie [this message]
2012-05-03 18:50 ` [PATCH 2/3] params: replace printk(KERN_<LVL>...) with pr_<lvl>(...) Joe Perches
2012-05-03 17:57 ` [PATCH 3/3] dynamic_debug: remove unneeded includes Jim Cromie
2012-05-05 4:36 ` Stephen Rothwell
2012-05-05 5:52 ` Jim Cromie
2012-05-05 6:08 ` Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2012-05-03 19:12 [PATCH 2/3] params: replace printk(KERN_<LVL>...) with pr_<lvl>(...) Jim Cromie
2012-05-03 19:23 ` Joe Perches
2012-05-04 0:22 Jim Cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336067860-19953-2-git-send-email-jim.cromie@gmail.com \
--to=jim.cromie@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox