lkml.org 
[lkml]   [2009]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] checkpatch: fix hang in relative indent checking
Date
I ran this command on v2.6.31 ,

./scripts/checkpatch.pl --file net/decnet/dn_fib.c

which resulted in checkpatch hanging without any output.

The lines that cause the hang are,

#define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\
for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)

The hang happend in the relative indent checking code. Checkpatch has the
following comment around the relative indent checking block,

# Also ignore a loop construct at the end of a
# preprocessor statement.

Since the line it's hanging on exactly fits the comment it shouldn't even be
checking this line. To resolve this I just prevent the checking like the
comment says should happen.

Signed-off-by: Daniel Walker <dwalker@fifo99.com>
---
scripts/checkpatch.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 09bab22..1c48a6c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1519,7 +1519,7 @@ sub process {

my $cond_ptr = -1;
$continuation = 0;
- while ($cond_ptr != $cond_lines) {
+ while ($check && $cond_ptr != $cond_lines) {
$cond_ptr = $cond_lines;

# If we see an #else/#elif then the code
--
1.5.6.3


\
 
 \ /
  Last update: 2009-09-22 04:17    [W:0.106 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site