<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/checkpatch.pl, branch v4.4.290</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.290</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.290'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-12-29T12:42:40Z</updated>
<entry>
<title>checkpatch: fix unescaped left brace</title>
<updated>2020-12-29T12:42:40Z</updated>
<author>
<name>Dwaipayan Ray</name>
<email>dwaipayanray1@gmail.com</email>
</author>
<published>2020-12-16T04:45:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a4afc3b522ca154bfff8bf8d8bbc4fbc7b865b02'/>
<id>urn:sha1:a4afc3b522ca154bfff8bf8d8bbc4fbc7b865b02</id>
<content type='text'>
[ Upstream commit 03f4935135b9efeb780b970ba023c201f81cf4e6 ]

There is an unescaped left brace in a regex in OPEN_BRACE check.  This
throws a runtime error when checkpatch is run with --fix flag and the
OPEN_BRACE check is executed.

Fix it by escaping the left brace.

Link: https://lkml.kernel.org/r/20201115202928.81955-1-dwaipayanray1@gmail.com
Fixes: 8d1824780f2f ("checkpatch: add --fix option for a couple OPEN_BRACE misuses")
Signed-off-by: Dwaipayan Ray &lt;dwaipayanray1@gmail.com&gt;
Acked-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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: fix the usage of capture group ( ... )</title>
<updated>2020-09-12T09:45:31Z</updated>
<author>
<name>Mrinal Pandey</name>
<email>mrinalmni@gmail.com</email>
</author>
<published>2020-09-04T23:35:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c85a849623b3b04ca4f6802a53d08a7144c5d26e'/>
<id>urn:sha1:c85a849623b3b04ca4f6802a53d08a7144c5d26e</id>
<content type='text'>
commit 13e45417cedbfc44b1926124b1846f5ee8c6ba4a upstream.

The usage of "capture group (...)" in the immediate condition after `&amp;&amp;`
results in `$1` being uninitialized.  This issues a warning "Use of
uninitialized value $1 in regexp compilation at ./scripts/checkpatch.pl
line 2638".

I noticed this bug while running checkpatch on the set of commits from
v5.7 to v5.8-rc1 of the kernel on the commits with a diff content in
their commit message.

This bug was introduced in the script by commit e518e9a59ec3
("checkpatch: emit an error when there's a diff in a changelog").  It
has been in the script since then.

The author intended to store the match made by capture group in variable
`$1`.  This should have contained the name of the file as `[\w/]+`
matched.  However, this couldn't be accomplished due to usage of capture
group and `$1` in the same regular expression.

Fix this by placing the capture group in the condition before `&amp;&amp;`.
Thus, `$1` can be initialized to the text that capture group matches
thereby setting it to the desired and required value.

Fixes: e518e9a59ec3 ("checkpatch: emit an error when there's a diff in a changelog")
Signed-off-by: Mrinal Pandey &lt;mrinalmni@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Tested-by: Lukas Bulwahn &lt;lukas.bulwahn@gmail.com&gt;
Reviewed-by: Lukas Bulwahn &lt;lukas.bulwahn@gmail.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Link: https://lkml.kernel.org/r/20200714032352.f476hanaj2dlmiot@mrinalpandey
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>checkpatch: silence perl 5.26.0 unescaped left brace warnings</title>
<updated>2017-07-21T05:44:57Z</updated>
<author>
<name>Cyril Bur</name>
<email>cyrilbur@gmail.com</email>
</author>
<published>2017-07-10T22:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4544e9ebef4c2f2536d3c7ca6c6a22d0f9f13d2f'/>
<id>urn:sha1:4544e9ebef4c2f2536d3c7ca6c6a22d0f9f13d2f</id>
<content type='text'>
commit 8d81ae05d0176da1c54aeaed697fa34be5c5575e upstream.

As of perl 5, version 26, subversion 0 (v5.26.0) some new warnings have
occurred when running checkpatch.

Unescaped left brace in regex is deprecated here (and will be fatal in
Perl 5.30), passed through in regex; marked by &lt;-- HERE in m/^(.\s*){
&lt;-- HERE \s*/ at scripts/checkpatch.pl line 3544.

Unescaped left brace in regex is deprecated here (and will be fatal in
Perl 5.30), passed through in regex; marked by &lt;-- HERE in m/^(.\s*){
&lt;-- HERE \s*/ at scripts/checkpatch.pl line 3885.

Unescaped left brace in regex is deprecated here (and will be fatal in
Perl 5.30), passed through in regex; marked by &lt;-- HERE in
m/^(\+.*(?:do|\))){ &lt;-- HERE / at scripts/checkpatch.pl line 4374.

It seems perfectly reasonable to do as the warning suggests and simply
escape the left brace in these three locations.

Link: http://lkml.kernel.org/r/20170607060135.17384-1-cyrilbur@gmail.com
Signed-off-by: Cyril Bur &lt;cyrilbur@gmail.com&gt;
Acked-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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>checkpatch: improve the unnecessary initialisers tests</title>
<updated>2015-11-07T01:50:42Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-11-07T00:31:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6d32f7a391466ed89d8a1018fdff5330766cc272'/>
<id>urn:sha1:6d32f7a391466ed89d8a1018fdff5330766cc272</id>
<content type='text'>
Global and static variables don't need to be initialized to 0.

There is already a test for this but the output message doesn't
mention booleans initialized to false.

Improve the output message and the test by adding various forms
with possible specific integer types and possible multiple zeros.

Miscellanea:

o Use a variable to hold the possible 0 test

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Shailendra Verma &lt;shailendra.v@samsung.com&gt;
Tested-by: Shailendra Verma &lt;shailendra.v@samsung.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: improve tests for fixes:, long lines and stack dumps in commit log</title>
<updated>2015-11-07T01:50:42Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2015-11-07T00:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=369c8dd390baffd77b892b563d03f800e65d2dfa'/>
<id>urn:sha1:369c8dd390baffd77b892b563d03f800e65d2dfa</id>
<content type='text'>
Including BUG and stack dumps in commit logs makes checkpatch produce some
false positive warning messages.

checkpatch has multiple types of false positives:

o Commit message lines &gt; 75 chars
o Stack dump address are mistaken for git commit IDs
o Link: and Fixes: lines are allowed to be &gt; 75 chars.
o Fixes: style doesn't require ("&lt;commit_description&gt;")
  parentheses and double quotes like other uses of
  git commit ID and description.

Fix these.

Miscellanea:

o Move the test for checking $commit_log_possible_stack_dump
  above the test for a long line commit message
o Add test for hex address surrounded by square or angle brackets

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Reported-by: Stephen Smalley &lt;sds@tycho.nsa.gov&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 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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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.stealer.net/cgit.cgi/user/sven/linux.git/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>
</feed>
