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: <47C017C4.20209@weinigel.se>
Date:	Sat, 23 Feb 2008 13:55:32 +0100
From:	Christer Weinigel <christer@...nigel.se>
To:	Andi Kleen <andi@...stfloor.org>
CC:	linux-kernel@...r.kernel.org, torvalds@...l.org
Subject: Re: [RFC/PATCH] Update coding standard to avoid ungrepable printk
 format strings

Andi Kleen wrote:
> RFC: Update coding standard to avoid split up printk format strings

While we're talking about checkpatch.pl, I'd definitely like to teach 
checkpatch about "list_for_each" and friends.

list_for_each is flow control, not a function call.  I find it much 
easier to see that something is a loop when there is a space between the 
name and the parenthesis rather than when they are smashed together.

old patch follows

   /Christer

checkpatch complains about the following:

WARNING: no space between function name and open parenthesis '('
#520: FILE: drivers/spi/spi_s3c24xx_dma.c:478:
+       list_for_each_entry (transfer, &message->transfers, transfer_list) {

which I think is a bit bogus since it actually is a for statement in
disguise.  The following patch adds list_for_each to the list of things
that look like functions that it shouldn't complain about.

Index: linux-2.6.23/scripts/checkpatch.pl
===================================================================
--- linux-2.6.23.orig/scripts/checkpatch.pl
+++ linux-2.6.23/scripts/checkpatch.pl
@@ -681,7 +681,7 @@ sub process {

  # check for spaces between functions and their parentheses.
  		if ($line =~ /($Ident)\s+\(/ &&
-		    $1 !~ 
/^(?:if|for|while|switch|return|volatile|__volatile__|__attribute__|format|__extension__|Copyright)$/ 
&&
+		    $1 !~ 
/^(?:if|for|while|switch|list_for_each.*|return|volatile|__volatile__|__attribute__|format|__extension__|Copyright)$/ 
&&
  		    $line !~ /$Type\s+\(/ && $line !~ /^.\#\s*define\b/) {
  			WARN("no space between function name and open parenthesis '('\n" . 
$herecurr);
  		}
--
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