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: <20071216215500.GB2419@martell.zuzino.mipt.ru>
Date:	Mon, 17 Dec 2007 00:55:00 +0300
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	Randy Dunlap <randy.dunlap@...cle.com>
Cc:	Ingo Molnar <mingo@...e.hu>, akpm <akpm@...ux-foundation.org>,
	Neil Brown <neilb@...e.de>, David Chinner <dgc@....com>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] umem nvram driver: clean up style

On Sun, Dec 16, 2007 at 01:15:58PM -0800, Randy Dunlap wrote:
> > btw., if anyone feels so inclined, this file has quite a number of 
> > coding style issues, as per scripts/checkpatch.pl output:
> > 
> >  total: 28 errors, 54 warnings, 1221 lines checked

> Cleanup umem driver: fix all checkpatch warnings, conform to kernel
> coding style.

> --- linux-2.6.24-rc5-git3.orig/drivers/block/umem.c
> +++ linux-2.6.24-rc5-git3/drivers/block/umem.c

>  static void check_batteries(struct cardinfo *card);
>  
>  /*
> ------------------------------------------------------------------------------------
> ---                           get_userbit
> ------------------------------------------------------------------------------------
> -*/
> + *                           get_userbit
> + */

useless comments, they aren't becoming useful after prettifying, right. ;-)

>  static void dump_dmastat(struct cardinfo *card, unsigned int dmastat)
>  {
>  	dev_printk(KERN_DEBUG, &card->dev->dev, "DMAstat - ");
>  	if (dmastat & DMASCR_ANY_ERR)
> -		printk("ANY_ERR ");
> +		printk(KERN_CONT "ANY_ERR ");
>  	if (dmastat & DMASCR_MBE_ERR)
> -		printk("MBE_ERR ");
> +		printk(KERN_CONT "MBE_ERR ");
>  	if (dmastat & DMASCR_PARITY_ERR_REP)
> -		printk("PARITY_ERR_REP ");
> +		printk(KERN_CONT "PARITY_ERR_REP ");
>  	if (dmastat & DMASCR_PARITY_ERR_DET)
> -		printk("PARITY_ERR_DET ");
> +		printk(KERN_CONT "PARITY_ERR_DET ");
>  	if (dmastat & DMASCR_SYSTEM_ERR_SIG)
> -		printk("SYSTEM_ERR_SIG ");
> +		printk(KERN_CONT "SYSTEM_ERR_SIG ");
>  	if (dmastat & DMASCR_TARGET_ABT)
> -		printk("TARGET_ABT ");
> +		printk(KERN_CONT "TARGET_ABT ");
>  	if (dmastat & DMASCR_MASTER_ABT)
> -		printk("MASTER_ABT ");
> +		printk(KERN_CONT "MASTER_ABT ");
>  	if (dmastat & DMASCR_CHAIN_COMPLETE)
> -		printk("CHAIN_COMPLETE ");
> +		printk(KERN_CONT "CHAIN_COMPLETE ");
>  	if (dmastat & DMASCR_DMA_COMPLETE)
> -		printk("DMA_COMPLETE ");
> +		printk(KERN_CONT "DMA_COMPLETE ");

KERN_NOISE, it's pretty hard to not notice transformation of
bitmask to string representation, isn't it?

> @@ -889,7 +866,8 @@ static int __devinit mm_pci_probe(struct
>  		return -ENODEV;
>  
>  	dev_printk(KERN_INFO, &dev->dev,
> -		"Micro Memory(tm) controller found (PCI Mem Module (Battery Backup))\n");
> +		"Micro Memory(tm) controller found "
> +		"(PCI Mem Module (Battery Backup))\n");

For the record, string splitting occasionaly makes grepping much more annoying:
grep. nothing? kernel in bugreport definitely spit it! [minute later]
Oh, I need to grep for smaller strings.

> @@ -1030,18 +1011,18 @@ static int __devinit mm_pci_probe(struct
>  	data = ~data;
>  	data += 1;
>  
> -	if (request_irq(dev->irq, mm_interrupt, IRQF_SHARED, DRIVER_NAME, card)) {
> +	if (request_irq(dev->irq, mm_interrupt, IRQF_SHARED, DRIVER_NAME,
> +			card)) {

Oh, c'mon!



And my pet peeve with checkpatch.pl crap: why does it force me to _add_
KERN_ markers when my patch changes code leaving printk intact, because
the patch wasn't about printk at all?

Or more philosophically, why a tool which doesn't parse C compiler-style
suddenly starts making suggestions on how C code should look like?
--
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