From: Joe Perches <joe@perches.com>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
xiyou.wangcong@gmail.com, stevie.trujillo@gmail.com,
kyungmin.park@samsung.com
Subject: Re: [PATCH 2/2] ramoops: add new line to printks
Date: Wed, 08 Jun 2011 09:22:44 -0700 [thread overview]
Message-ID: <1307550164.16453.2.camel@Joe-Laptop> (raw)
In-Reply-To: <4DEE5737.9060404@gmail.com>
On Tue, 2011-06-07 at 18:52 +0200, Marco Stornelli wrote:
> From: Marco Stornelli <marco.stornelli@gmail.com>
> Add new line to each printk.
Perhaps use pr_<level> and pr_fmt instead?
---
drivers/char/ramoops.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c
index 1a9f5f6..1283180 100644
--- a/drivers/char/ramoops.c
+++ b/drivers/char/ramoops.c
@@ -19,6 +19,8 @@
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kmsg_dump.h>
@@ -112,14 +114,14 @@ static int __init ramoops_probe(struct platform_device *pdev)
}
if (!mem_size) {
- printk(KERN_ERR "ramoops: invalid size specification");
+ pr_err("invalid size specification\n");
goto fail3;
}
rounddown_pow_of_two(mem_size);
if (mem_size < RECORD_SIZE) {
- printk(KERN_ERR "ramoops: size too small");
+ pr_err("size too small\n");
goto fail3;
}
@@ -129,21 +131,21 @@ static int __init ramoops_probe(struct platform_device *pdev)
cxt->phys_addr = mem_address;
if (!request_mem_region(cxt->phys_addr, cxt->size, "ramoops")) {
- printk(KERN_ERR "ramoops: request mem region failed");
+ pr_err("request mem region failed\n");
err = -EINVAL;
goto fail3;
}
cxt->virt_addr = ioremap(cxt->phys_addr, cxt->size);
if (!cxt->virt_addr) {
- printk(KERN_ERR "ramoops: ioremap failed");
+ pr_err("ioremap failed\n");
goto fail2;
}
cxt->dump.dump = ramoops_do_dump;
err = kmsg_dump_register(&cxt->dump);
if (err) {
- printk(KERN_ERR "ramoops: registering kmsg dumper failed");
+ pr_err("registering kmsg dumper failed\n");
goto fail1;
}
@@ -162,7 +164,7 @@ static int __exit ramoops_remove(struct platform_device *pdev)
struct ramoops_context *cxt = &oops_cxt;
if (kmsg_dump_unregister(&cxt->dump) < 0)
- printk(KERN_WARNING "ramoops: could not unregister kmsg_dumper");
+ pr_warn("could not unregister kmsg_dumper\n");
iounmap(cxt->virt_addr);
release_mem_region(cxt->phys_addr, cxt->size);
next prev parent reply other threads:[~2011-06-08 16:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-28 14:48 [PATCH 2/2] ramoops: add new line to printks Marco Stornelli
2011-06-07 16:52 ` Marco Stornelli
2011-06-08 16:02 ` Américo Wang
2011-06-08 16:22 ` Joe Perches [this message]
2011-06-08 19:07 ` [PATCH 2/2 v2] ramoops: add new line to each print Marco Stornelli
2011-06-08 19:27 ` Joe Perches
2011-06-08 19:24 ` Marco Stornelli
2011-06-08 19:47 ` [PATCH 2/2 v3] " Marco Stornelli
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=1307550164.16453.2.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.stornelli@gmail.com \
--cc=stevie.trujillo@gmail.com \
--cc=xiyou.wangcong@gmail.com \
/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