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

From: Dan Carpenter
Date: Sat Jan 21 2012 - 10:51:55 EST


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

Attachment: signature.asc
Description: Digital signature