<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/checkpatch.pl, branch v4.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-09-10T20:29:01Z</updated>
<entry>
<title>checkpatch: add constant comparison on left side test</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c5595fa2f1ce3c1a74dbd2ddc949257e80d81dc0'/>
<id>urn:sha1:c5595fa2f1ce3c1a74dbd2ddc949257e80d81dc0</id>
<content type='text'>
"CONST &lt;comparison&gt; variable" checks like:

        if (NULL != foo)
and
        while (0 &lt; bar(...))

where a constant (or what appears to be a constant like an upper case
identifier) is on the left of a comparison are generally preferred to be
written using the constant on the right side like:

        if (foo != NULL)
and
        while (bar(...) &gt; 0)

Add a test for this.

Add a --fix option too, but only do it when the code is immediately
surrounded by parentheses to avoid misfixing things like "(0 &lt; bar() +
constant)"

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Nicolas Morey Chaisemartin &lt;nmorey@kalray.eu&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.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 __pmem to $Sparse annotations</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54507b5183cc4f8e4f1a58a312e1f30c130658b7'/>
<id>urn:sha1:54507b5183cc4f8e4f1a58a312e1f30c130658b7</id>
<content type='text'>
commit 61031952f4c8 ("arch, x86: pmem api for ensuring durability of
persistent memory updates") added a new __pmem annotation for sparse
verification.  Add __pmem to the $Sparse variable so checkpatch can
appropriately ignore uses of this attribute too.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Reviewed-by: Ross Zwisler &lt;ross.zwisler@linux.intel.com&gt;
Acked-by: 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: fix left brace warning</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Eddie Kovsky</name>
<email>ewk@edkovsky.org</email>
</author>
<published>2015-09-09T22:37:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e5d56bdf892e18832a6540b63ebf709966bce2a'/>
<id>urn:sha1:4e5d56bdf892e18832a6540b63ebf709966bce2a</id>
<content type='text'>
Using checkpatch.pl with Perl 5.22.0 generates the following warning:

    Unescaped left brace in regex is deprecated, passed through in regex;

This patch fixes the warnings by escaping occurrences of the left brace
inside the regular expression.

Signed-off-by: Eddie Kovsky &lt;ewk@edkovsky.org&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: avoid some commit message long line warnings</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bf4daf12a9fbc818029051c97b65fbfca6366a44'/>
<id>urn:sha1:bf4daf12a9fbc818029051c97b65fbfca6366a44</id>
<content type='text'>
Fixes: and Link: lines may exceed 75 chars in the commit log.

So too can stack dump and dmesg lines and lines that seem
like filenames.

And Fixes: lines don't need to have a "commit" prefix before the
commit id.

Add exceptions for these types of lines.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Reported-by: Paul Bolle &lt;pebolle@tiscali.nl&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: emit an error on formats with 0x%&lt;decimal&gt;</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6e30075742316a1d72b7e8f794f6e0bd44d774e2'/>
<id>urn:sha1:6e30075742316a1d72b7e8f794f6e0bd44d774e2</id>
<content type='text'>
Using 0x%d is wrong.  Emit a message when it happens.

Miscellanea:

Improve the %Lu warning to match formats like %16Lu.

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: make --strict the default for drivers/staging files and patches</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7bd7e483c27d884c2f59e286e42623abba413f83'/>
<id>urn:sha1:7bd7e483c27d884c2f59e286e42623abba413f83</id>
<content type='text'>
Making --strict the default for staging may help some people submit
patches without obvious defects.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.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: always check block comment styles</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86406b1cb7ac4fa5e7691eae5f2fb10c9af03dc3'/>
<id>urn:sha1:86406b1cb7ac4fa5e7691eae5f2fb10c9af03dc3</id>
<content type='text'>
Some of the block comment tests that are used only for networking are
appropriate for all patches.

For example, these styles are not encouraged:

	/*
	 block comment without introductory *
	*/
and
	/*
	 * block comment with line terminating */

Remove the networking specific test and add comments.

There are some infrequent false positives where code is lazily
commented out using /* and */ rather than using #if 0/#endif blocks
like:
	/* case foo:
	case bar: */
	case baz:

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: report the right line # when using --emacs and --file</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d3a9f673e1bdb45f86d15a67e230e4a9b050850'/>
<id>urn:sha1:7d3a9f673e1bdb45f86d15a67e230e4a9b050850</id>
<content type='text'>
commit 34d8815f9512 ("checkpatch: add --showfile to allow input via pipe
to show filenames") broke the --emacs with --file option.

Fix it.

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: add some &lt;foo&gt;_destroy functions to NEEDLESS_IF tests</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=100425deeb7586c9d401f787aeab3b43a4c6a0c6'/>
<id>urn:sha1:100425deeb7586c9d401f787aeab3b43a4c6a0c6</id>
<content type='text'>
Sergey Senozhatsky has modified several destroy functions that can
now be called with NULL values.

 - kmem_cache_destroy()
 - mempool_destroy()
 - dma_pool_destroy()

Update checkpatch to warn when those functions are preceded by an if.

Update checkpatch to --fix all the calls too only when the code style
form is using leading tabs.

from:
	if (foo)
		&lt;func&gt;(foo);
to:
	&lt;func&gt;(foo);

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Tested-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Julia Lawall &lt;julia.lawall@lip6.fr&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: Allow longer declaration macros</title>
<updated>2015-09-10T20:29:01Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-09-09T22:37:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e838b6c41e8ac86c992bdaaa78625faf528a578'/>
<id>urn:sha1:3e838b6c41e8ac86c992bdaaa78625faf528a578</id>
<content type='text'>
Some really long declaration macros exist.

For instance;
  	DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
and
	DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(name, description)

Increase the limit from 2 words to 6 after DECLARE/DEFINE uses.

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>
</feed>
