mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jingoo Han <jg1.han@samsung.com>
Cc: "'LKML'" <linux-kernel@vger.kernel.org>,
	"'Richard Purdie'" <rpurdie@rpsys.net>,
	"'Matthew Garrett'" <mjg@redhat.com>
Subject: Re: [PATCH 2/7] backlight: apple_bl: use pr_debug/err instead of printk
Date: Tue, 15 May 2012 14:15:19 -0700	[thread overview]
Message-ID: <20120515141519.594da6d9.akpm@linux-foundation.org> (raw)
In-Reply-To: <000d01cd326f$b9d5d610$2d818230$%han@samsung.com>

On Tue, 15 May 2012 16:52:50 +0900
Jingoo Han <jg1.han@samsung.com> wrote:

> This patch uses pr_debug/err instead of printk to allow dynamic debugging.
> It also fixes checkpatch warnings as below:
> 
> WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
> WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
> 
> ...
>
> --- a/drivers/video/backlight/apple_bl.c
> +++ b/drivers/video/backlight/apple_bl.c
> @@ -61,8 +61,7 @@ static int intel_chipset_send_intensity(struct backlight_device *bd)
>  	int intensity = bd->props.brightness;
>  
>  	if (debug)
> -		printk(KERN_DEBUG DRIVER "setting brightness to %d\n",
> -		       intensity);
> +		pr_debug("setting brightness to %d\n", intensity);

This looks wrong.  It replaces

	apple_backlight: setting brightness to 42

with

	setting brightness to 42

To do this properly we should do

#define pf_fmt "apple_backlight: "

before including printk.h.  Conventionally this is done before
including any headers.

Also, apple_bl.c should explicitly include printk.h.

If doing this, please remove the DRIVER #define altogether.



Please check all the other drivers in this patchset.  If they already
have custom things like DRIVER then remove that, define pr_fmt then
convert all the messages.

In other words, I'm recommending a functional change.  For example,
drivers/video/backlight/generic_bl.c currently prints

	Generic Backlight Driver Initialized

and I'm recommending that we switch this to

	generic_bl: Generic Backlight Driver Initialized




      reply	other threads:[~2012-05-15 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15  7:52 Jingoo Han
2012-05-15 21:15 ` Andrew Morton [this message]

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=20120515141519.594da6d9.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rpurdie@rpsys.net \
    /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®