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-next>] [day] [month] [year] [list]
Date:	Fri, 08 Jun 2007 10:11:05 -0700
From:	Dan Williams <dan.j.williams@...el.com>
To:	apw@...dowen.org, rdunlap@...otime.net, jschopp@...tin.ibm.com
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] checkpatch: add an exclusion for 'for_each' helper macros

checkpatch currently complains about macros like the following:

#define for_each_dma_cap_mask(cap, mask) \
	for ((cap) = first_dma_cap(mask);       \
		(cap) < DMA_TX_TYPE_END;        \
		(cap) = next_dma_cap((cap), (mask)))


Signed-off-by: Dan Williams <dan.j.williams@...el.com>
---

 scripts/checkpatch.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e216d49..ee6bac9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -548,10 +548,10 @@ sub process {
 			}
 		}
 
-#multiline macros should be enclosed in a do while loop
+#multiline macros should be enclosed in a do while loop, unless they are a for_each helper
 		if (($prevline=~/\#define.*\\/) and !($prevline=~/do\s+{/) and
 		   !($prevline=~/\(\{/) and ($line=~/;\s*\\/) and
-		   !($line=~/do.*{/) and !($line=~/\(\{/)) {
+		   !($line=~/do.*{/) and !($line=~/\(\{/) and !($prevline=~/.*for_each.*/)) {
 			print "Macros with multiple statements should be enclosed in a do - while loop\n";
 			print "$hereprev";
 			$clean = 0;
-
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