Re: [PATCH 2/7] backlight: apple_bl: use pr_debug/err instead ofprintk
From: Andrew Morton
Date: Tue May 15 2012 - 17:15:18 EST
On Tue, 15 May 2012 16:52:50 +0900
Jingoo Han <jg1.han@xxxxxxxxxxx> 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
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
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/