X86 platform drivers
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Joey Lee <jlee@novell.com>
Cc: corentincj@iksaif.net, mjg@redhat.com,
	carlos@strangeworlds.co.uk, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] msi-laptop: use pr_<level> for messages
Date: Wed, 16 Mar 2011 01:22:11 -0700	[thread overview]
Message-ID: <20110316082211.GC25912@core.coreip.homeip.net> (raw)
In-Reply-To: <4D8107970200002300029E69@novprvlin0050.provo.novell.com>

Hi Joey,

On Wed, Mar 16, 2011 at 01:55:19AM -0600, Joey Lee wrote:
> Hi Dmitry, 
> 
> 於 六,2011-03-12 於 22:31 -0800,Dmitry Torokhov 提到:
> > >  
> > >  static int dmi_check_cb(const struct dmi_system_id *id)
> > >  {
> > > -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> > > -	       id->ident);
> > > +	pr_info("msi-laptop: Identified laptop model '%s'.\n", id->ident);
> > 
> > No, you need to add:
> > 
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > 
> > at the very beginning of your driver (before includes) and then just do
> > 
> > 	pr_info("Identified laptop model '%s'.\n", id->ident);
> > 
> > and pr_fmt() will ensure that alll your messages use consistent prefix.
> > 
> > Thanks.
> > 
> 
> Thank's for your teach, it works fine to me. Follow your suggestion, I
> fixed my patch like the following, please kindly review it again:
> 
> 
> >From 31123fcc91b073b329a970b075041eaec523b106 Mon Sep 17 00:00:00 2001
> From: Lee, Chun-Yi <jlee@novell.com>
> Date: Wed, 16 Mar 2011 15:44:40 +0800
> Subject: [PATCH] msi-laptop: use pr_<level> for messages
> 
> msi-laptop: use pr_<level> for messages
> 
> Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> Cc: Corentin Chary <corentincj@iksaif.net>
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>

Looks good to me.

Reviewed-by: Dmitry Torokhov <dtor@mail.ru>

> ---
>  drivers/platform/x86/msi-laptop.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> index 028d2c6..0de6d43 100644
> --- a/drivers/platform/x86/msi-laptop.c
> +++ b/drivers/platform/x86/msi-laptop.c
> @@ -51,6 +51,8 @@
>   * laptop as MSI S270. YMMV.
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
> @@ -445,8 +447,7 @@ static struct platform_device *msipf_device;
>  
>  static int dmi_check_cb(const struct dmi_system_id *id)
>  {
> -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> -	       id->ident);
> +	pr_info("Identified laptop model '%s'.\n", id->ident);
>  	return 1;
>  }
>  
> @@ -834,8 +835,7 @@ static int load_scm_model_init(struct platform_device *sdev)
>  
>  	result = i8042_install_filter(msi_laptop_i8042_filter);
>  	if (result) {
> -		printk(KERN_ERR
> -			"msi-laptop: Unable to install key filter\n");
> +		pr_err("Unable to install key filter\n");
>  		goto fail_filter;
>  	}
>  
> @@ -875,7 +875,7 @@ static int __init msi_init(void)
>  	/* Register backlight stuff */
>  
>  	if (acpi_video_backlight_support()) {
> -		printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
> +		pr_info("Brightness ignored, must be controlled "
>  		       "by ACPI video driver\n");
>  	} else {
>  		struct backlight_properties props;
> @@ -929,7 +929,7 @@ static int __init msi_init(void)
>  	if (auto_brightness != 2)
>  		set_auto_brightness(auto_brightness);
>  
> -	printk(KERN_INFO "msi-laptop: driver "MSI_DRIVER_VERSION" successfully loaded.\n");
> +	pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
>  
>  	return 0;
>  
> @@ -977,7 +977,7 @@ static void __exit msi_cleanup(void)
>  	if (auto_brightness != 2)
>  		set_auto_brightness(1);
>  
> -	printk(KERN_INFO "msi-laptop: driver unloaded.\n");
> +	pr_info("driver unloaded.\n");
>  }
>  
>  module_init(msi_init);
> -- 
> 1.6.0.2
> 
> 
> 
> 

-- 
Dmitry

  reply	other threads:[~2011-03-16  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 11:02 [PATCH] msi-laptop: use pr_<level> for messages Lee, Chun-Yi
2011-03-13  6:31 ` Dmitry Torokhov
2011-03-16  7:55   ` Joey Lee
2011-03-16  8:22     ` Dmitry Torokhov [this message]
2011-03-16  9:59       ` Joey Lee

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=20110316082211.GC25912@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=carlos@strangeworlds.co.uk \
    --cc=corentincj@iksaif.net \
    --cc=jlee@novell.com \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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