<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/checkpatch.pl, branch v3.6.5</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.6.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.6.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-08-21T23:45:02Z</updated>
<entry>
<title>checkpatch: add control statement test to SINGLE_STATEMENT_DO_WHILE_MACRO</title>
<updated>2012-08-21T23:45:02Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-08-21T23:15:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ac8e97f8a742828daa1d9de37f6e635888f8d71e'/>
<id>urn:sha1:ac8e97f8a742828daa1d9de37f6e635888f8d71e</id>
<content type='text'>
Commit b13edf7ff2dd ("checkpatch: add checks for do {} while (0) macro
misuses") added a test that is overly simplistic for single statement
macros.

Macros that start with control tests should be enclosed in a do {} while
(0) loop.

Add the necessary control tests to the check.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Acked-by: Andy Whitcroft &lt;apw@canonical.com&gt;
Tested-by: Franz Schrober &lt;franzschrober@yahoo.de&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: add checks for do {} while (0) macro misuses</title>
<updated>2012-07-31T00:25:17Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-07-30T21:41:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b13edf7ff2dd0fef95e981170fa71fa6b60421b0'/>
<id>urn:sha1:b13edf7ff2dd0fef95e981170fa71fa6b60421b0</id>
<content type='text'>
These types of macros should not be used for either a single statement
nor should the macro end with a semi-colon.

Add tests for these conditions.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: Add acheck for use of sizeof without parenthesis</title>
<updated>2012-07-31T00:25:17Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-07-30T21:41:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=66c80b6077256898df948ac6acf547b47ddb1fcf'/>
<id>urn:sha1:66c80b6077256898df948ac6acf547b47ddb1fcf</id>
<content type='text'>
Kernel style uses parenthesis around sizeof.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: check usleep_range() arguments</title>
<updated>2012-07-31T00:25:17Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-07-30T21:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4a273195a551a27a9a3ebed072c8df16c853da7f'/>
<id>urn:sha1:4a273195a551a27a9a3ebed072c8df16c853da7f</id>
<content type='text'>
usleep_range() shouldn't use the same args for min and max.

Report it when it happens and when both args are decimal and min &gt; max.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Yuval Mintz &lt;yuvalmin@broadcom.com&gt;
Cc: Andy Whitcroft &lt;apw@shadowen.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: test for non-standard signatures</title>
<updated>2012-07-31T00:25:17Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-07-30T21:41:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ce0338df3c9a43e709b8a478265b32b9edcc7ccc'/>
<id>urn:sha1:ce0338df3c9a43e709b8a478265b32b9edcc7ccc</id>
<content type='text'>
Warn on non-standard signature styles.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: Update alignment check</title>
<updated>2012-07-31T00:25:17Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-07-30T21:41:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b34a26f3158cca932b6f1427b97fe12c7838ee68'/>
<id>urn:sha1:b34a26f3158cca932b6f1427b97fe12c7838ee68</id>
<content type='text'>
Parenthesis alignment doesn't correctly check an existing line after an
inserted or modified line with an open parenthesis.

Fix it.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: suggest pr_&lt;level&gt; over printk(KERN_&lt;LEVEL&gt;</title>
<updated>2012-06-01T00:49:27Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-05-31T23:26:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=243f3803cf2a3665092c5fd6f924f453694681a6'/>
<id>urn:sha1:243f3803cf2a3665092c5fd6f924f453694681a6</id>
<content type='text'>
Suggest the shorter pr_&lt;level&gt; instead of printk(KERN_&lt;LEVEL&gt;.

Prefer to use pr_&lt;level&gt; over bare printks.
Prefer to use pr_warn over pr_warning.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@shadowen.org&gt;
Cc: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: check for whitespace before semicolon at EOL</title>
<updated>2012-06-01T00:49:27Z</updated>
<author>
<name>Eric Nelson</name>
<email>eric.nelson@boundarydevices.com</email>
</author>
<published>2012-05-31T23:26:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9a4cad4e25b91f48494f13fce3d25ea44bec7472'/>
<id>urn:sha1:9a4cad4e25b91f48494f13fce3d25ea44bec7472</id>
<content type='text'>
Requires --strict option during invocation:
	~/linux$ scripts/checkpatch --strict foo.patch

This tests for a bad habits of mine like this:

	return 0 ;

Note that it does allow a special case of a bare semicolon
for empty loops:

	while (foo())
		;

Signed-off-by: Eric Nelson &lt;eric.nelson@boundarydevices.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: revert --strict test for net/ and drivers/net block comment style</title>
<updated>2012-04-16T19:44:38Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-04-16T19:35:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c06a9ebdb7a4f4823d4225fe789d8c20a1d534eb'/>
<id>urn:sha1:c06a9ebdb7a4f4823d4225fe789d8c20a1d534eb</id>
<content type='text'>
Revert the --strict test for the old preferred block
comment style in drivers/net and net/

Reported-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: check for quoted strings broken across lines</title>
<updated>2012-03-23T23:58:37Z</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2012-03-23T22:02:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ca56dc098caf93b5437cd6c4ee49f02aa18f84d6'/>
<id>urn:sha1:ca56dc098caf93b5437cd6c4ee49f02aa18f84d6</id>
<content type='text'>
checkpatch already makes an exception to the 80-column rule for quoted
strings, and Documentation/CodingStyle recommends not splitting quoted
strings across lines, because it breaks the ability to grep for the
string.  Rather than just permitting this, actively warn about quoted
strings split across lines.

Test case:

void context(void)
{
	struct { unsigned magic; const char *strdata; } foo[] = {
		{ 42, "these strings"
		      "do not produce warnings" },
		{ 256, "though perhaps"
		       "they should" },
	};
	pr_err("this string"
	       " should produce a warning\n");
	pr_err("this multi-line string\n"
	       "should not produce a warning\n");
	asm ("this asm\n\t"
	     "should not produce a warning");
}

Results of checkpatch on that test case:

WARNING: quoted string split across lines
+	       " should produce a warning\n");

total: 0 errors, 1 warnings, 15 lines checked

Signed-off-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Acked-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
