mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Toshiaki Yamane <yamanetoshi@gmail.com>
Cc: greg@kroah.com, willy@meta-x.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...)
Date: Tue, 10 Jul 2012 13:59:14 -0700	[thread overview]
Message-ID: <1341953954.6118.167.camel@joe2Laptop> (raw)
In-Reply-To: <1341919515-8909-1-git-send-email-yamanetoshi@gmail.com>

On Tue, 2012-07-10 at 20:25 +0900, Toshiaki Yamane wrote:
> This change is inspired by checkpatch.

[]

Please add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any #include

and remove the "panel: " prefixes from output messages.

> diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
[]
> @@ -1987,7 +1987,7 @@ static struct logical_input *panel_bind_key(char *name, char *press,
>  
>  	key = kzalloc(sizeof(struct logical_input), GFP_KERNEL);
>  	if (!key) {
> -		printk(KERN_ERR "panel: not enough memory\n");
> +		pr_err("panel: not enough memory\n");

OOM messages are duplicative and unnecessary.
alloc failures get a dump_stack.

[]

> @@ -2109,8 +2109,7 @@ static void panel_attach(struct parport *port)
>  		return;
>  
>  	if (pprt) {
> -		printk(KERN_ERR
> -		       "panel_attach(): port->number=%d parport=%d, "
> +		pr_err("panel_attach(): port->number=%d parport=%d, "
>  		       "already registered !\n",

Please coalesce formats and use "%s: ...", __func__ when there
is an embedded function name.  It'd also be nice to use argument
alignment to open parenthesis.

		pr_err("%s: port->number=%d parport=%d, already registered\n",
		       port->number, parport);


etc...

cheers, Joe


  reply	other threads:[~2012-07-11  0:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10 11:22 [PATCH 1/3] panel: Use pr_debug(...) rather than printk(KERN_DEBUG ...) Toshiaki Yamane
2012-07-10 11:24 ` [PATCH 2/3] panel: Use pr_info(...) rather than printk(KERN_INFO ...) Toshiaki Yamane
2012-07-10 11:25 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane
2012-07-10 20:59   ` Joe Perches [this message]
2012-07-10 20:58 ` [PATCH 1/3] panel: Use pr_debug(...) rather than printk(KERN_DEBUG ...) Joe Perches
2012-07-12 13:00 [PATCH 1/3] panel: Remove printk(KERN_DEBUG ...) located in the #if 0 block Toshiaki Yamane
2012-07-12 13:01 ` [PATCH 3/3] panel: Use pr_err(...) rather than printk(KERN_ERR ...) Toshiaki Yamane

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=1341953954.6118.167.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@meta-x.org \
    --cc=yamanetoshi@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

all inboxes | Powered by JetHome®