The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Sam Hansen <solid.se7en@gmail.com>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] xgifb: checkpatch cleanup, printk() KERN_*
Date: Sat, 21 Jan 2012 08:42:23 -0800	[thread overview]
Message-ID: <1327164143.2050.9.camel@joe2Laptop> (raw)
In-Reply-To: <1327140612-9694-3-git-send-email-solid.se7en@gmail.com>

On Sat, 2012-01-21 at 02:10 -0800, Sam Hansen wrote:
> Added KERN_ facility levels in XGI_main_26.c and vb_init.c in a few different
> printk() statements.
[]
> @@ -2018,12 +2018,12 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
>  	printk(KERN_INFO "XGIfb: MMIO at 0x%lx, mapped to 0x%p, size %ldk\n",
>  	       xgifb_info->mmio_base, xgifb_info->mmio_vbase,
>  	       xgifb_info->mmio_size / 1024);
> -	printk("XGIfb: XGIInitNew() ...");
> +	printk(KERN_INFO "XGIfb: XGIInitNew() ...");
>  	pci_set_drvdata(pdev, xgifb_info);
>  	if (XGIInitNew(pdev))
> -		printk("OK\n");
> +		printk(KERN_INFO "OK\n");
>  	else
> -		printk("Fail\n");
> +		printk(KERN_ERR "Fail\n");

These last two should be KERN_CONT
though the block could be rewritten as

	if (XGIInitNew(pdev))
		printk(KERN_INFO "XGIfb: XGIInitNew() ... OK\n");
 	else
		printk(KERN_ERR "XGIfb: XGIInitNew() ... Fail\n");

Emitting any dmesg output like "XGIInitNew() ... OK\n"
is almost always low value.

Perhaps just emitting on the error case is better:
	if (!XGIInitNew(pdev))
		printk(KERN_ERR "XGIfb: XBIInitNew() failed\n");

One other thing.  It would be better to add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
before any #include and convert all the
printks(KERN_<LEVEL> to pr_<level>( 
stripping all the leading XGIfb: too.



  parent reply	other threads:[~2012-01-21 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21 10:10 [PATCH 1/3] xgifb: checkpatch cleanup, braces Sam Hansen
2012-01-21 10:10 ` [PATCH 2/3] xgifb: checkpatch cleanup __func__ Sam Hansen
2012-01-21 10:10 ` [PATCH 3/3] xgifb: checkpatch cleanup, printk() KERN_* Sam Hansen
2012-01-21 15:52   ` Dan Carpenter
2012-01-21 17:13     ` sam hansen
2012-01-21 16:42   ` Joe Perches [this message]
2012-01-21 17:18     ` sam hansen
2012-01-21 19:22     ` sam hansen
2012-01-21 19:45       ` Joe Perches

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=1327164143.2050.9.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=arnaud.patard@rtp-net.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=solid.se7en@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