lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120515141519.594da6d9.akpm@linux-foundation.org>
Date:	Tue, 15 May 2012 14:15:19 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Jingoo Han <jg1.han@...sung.com>
Cc:	"'LKML'" <linux-kernel@...r.kernel.org>,
	"'Richard Purdie'" <rpurdie@...ys.net>,
	"'Matthew Garrett'" <mjg@...hat.com>
Subject: Re: [PATCH 2/7] backlight: apple_bl: use pr_debug/err instead of
 printk

On Tue, 15 May 2012 16:52:50 +0900
Jingoo Han <jg1.han@...sung.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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ