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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1327164143.2050.9.camel@joe2Laptop>
Date:	Sat, 21 Jan 2012 08:42:23 -0800
From:	Joe Perches <joe@...ches.com>
To:	Sam Hansen <solid.se7en@...il.com>
Cc:	Arnaud Patard <arnaud.patard@...-net.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Aaro Koskinen <aaro.koskinen@....fi>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] xgifb: checkpatch cleanup, printk() KERN_*

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.


--
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