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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Sep 2010 19:15:39 +0100
From:	David Howells <dhowells@...hat.com>
To:	Joe Perches <joe@...ches.com>
Cc:	dhowells@...hat.com, Andy Whitcroft <apw@...onical.com>,
	linux-kernel@...r.kernel.org
Subject: Re: checkpatch problem


The problem is that the second matcher (looking for " to \\n) matches on more
than just the logfunction line.  Instrumenting the code supplied by your patch
thusly:

		if ($line =~ /^.*($logFunctions)/) {
		    print "QQQQ $1 QQQQ\n";
			my $ln = $linenr;
			my $cnt = $realcnt;
			my ($off, $dstat, $dcond, $rest);
			($dstat, $dcond, $ln, $cnt, $off) =
				ctx_statement_block($linenr, $realcnt, 0);
			for (my $n = 0; $n < $cnt; $n++) {
			    my $l = $rawlines[$ln-1+$n];
			    if ($l =~ /(\".*[ \t]\\n)/) {
				print "&&&$line&&&\n";
				print "^^^^^ Matched '$1' ^^^^^\n";
				WARN("Logging function has unnecessary whitespace before a newline\n" . $herecurr);
			    }
			}
		    }

I see:

QQQQ printk QQQQ
QQQQ printk QQQQ
QQQQ printk QQQQ
QQQQ printk QQQQ
QQQQ printk QQQQ
&&&+#define Dprintk(fmt, ...) printk(KERN_DEBUG fmt, ##__VA_ARGS__)&&&
^^^^^ Matched '"mov	%0,sp	\n' ^^^^^
&&&+#define Dprintk(fmt, ...) printk(KERN_DEBUG fmt, ##__VA_ARGS__)&&&
^^^^^ Matched '"jmp	(%1)	\n' ^^^^^
&&&+#define Dprintk(fmt, ...) printk(KERN_DEBUG fmt, ##__VA_ARGS__)&&&
^^^^^ Matched '"	movhu	(%1),%0	\n' ^^^^^


It seems that it doesn't like a #define dealing with a logging function
followed by an inline asm statement that has whitespace before '\\n'.

I suspect checkpatch doesn't handle #defines correctly, and goes beyond their
end looking for a semicolon.

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