[PATCH 3/3] xgifb: checkpatch cleanup, printk() KERN_*

Dan Carpenter dan.carpenter at oracle.com
Sat Jan 21 07:52:35 PST 2012


On Sat, Jan 21, 2012 at 02:10:12AM -0800, Sam Hansen wrote:
>  	if (reg1 != 0xa1) { /*I/O error */
> -		printk("\nXGIfb: I/O error!!!");
> +		printk(KERN_ERR "\nXGIfb: I/O error!!!");

It doesn't make sense to do this.  KERN_ERR puts a "<3>" in front of
the line so we know how important it is, but it's a blank line
because of the "\n" at the start.

Also the should probably be using pr_err() or dev_err().

> -	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 put a "<3>" in the middle of the line which doesn't help
anyone.  Rewrite it so it's on one line.  Get rid of the OK line.

>  	if (pVBInfo->FBAddr == NULL) {
> -		printk("\n pVBInfo->FBAddr == 0 ");
> +		printk(KERN_INFO "\n pVBInfo->FBAddr == 0 ");

Same.

regards,
dan carpenter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://driverdev.linuxdriverproject.org/pipermail/devel/attachments/20120121/3aa5c1be/attachment.asc>


More information about the devel mailing list