<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/tools/patman/test_checkpatch.py, branch v2022.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/tools/patman/test_checkpatch.py?h=v2022.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/tools/patman/test_checkpatch.py?h=v2022.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2021-04-12T21:44:55Z</updated>
<entry>
<title>checkpatch: Add warnings for using strn(cat|cpy)</title>
<updated>2021-04-12T21:44:55Z</updated>
<author>
<name>Sean Anderson</name>
<email>seanga2@gmail.com</email>
</author>
<published>2021-03-11T05:15:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d9c305071069164feceaff3e543c61693bc2c401'/>
<id>urn:sha1:d9c305071069164feceaff3e543c61693bc2c401</id>
<content type='text'>
strn(cat|cpy) has a bad habit of not nul-terminating the destination,
resulting in constructions like

	strncpy(foo, bar, sizeof(foo) - 1);
	foo[sizeof(foo) - 1] = '\0';

However, it is very easy to forget about this behavior and accidentally
leave a string unterminated. This has shown up in some recent coverity
scans [1, 2] (including code recently touched by yours truly).

Fortunately, the guys at OpenBSD came up with strl(cat|cpy), which always
nul-terminate strings. These functions are already in U-Boot, so we should
encourage new code to use them instead of strn(cat|cpy).

[1] https://lists.denx.de/pipermail/u-boot/2021-March/442888.html
[2] https://lists.denx.de/pipermail/u-boot/2021-January/438073.html

Signed-off-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: Add warnings for unexpected struct names</title>
<updated>2020-12-13T23:51:09Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-12-03T23:55:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b7bbd553de0d9752f919dfc616f560f6f2504c14'/>
<id>urn:sha1:b7bbd553de0d9752f919dfc616f560f6f2504c14</id>
<content type='text'>
As a way of keeping the driver declarations more consistent, add a warning
if the struct used does not end with _priv or _plat.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Rename functions in patchstream</title>
<updated>2020-11-05T16:11:31Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-10-30T03:46:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d93720e13800423d3d6c9f8318d5a75ce7362639'/>
<id>urn:sha1:d93720e13800423d3d6c9f8318d5a75ce7362639</id>
<content type='text'>
Rename these functions to lower case as per PEP8.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>checkpatch.pl: Make CONFIG_IS_ENABLED(CONFIG_*) an error</title>
<updated>2020-10-14T15:16:34Z</updated>
<author>
<name>Alper Nebi Yasak</name>
<email>alpernebiyasak@gmail.com</email>
</author>
<published>2020-10-05T06:57:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b9cca2c57a7f3f51dc044030a2f1665e517edb51'/>
<id>urn:sha1:b9cca2c57a7f3f51dc044030a2f1665e517edb51</id>
<content type='text'>
CONFIG_IS_ENABLED() takes the kconfig name without the CONFIG_ prefix,
e.g. CONFIG_IS_ENABLED(CLK) for CONFIG_CLK. Make including the prefix
an error in checkpatch.pl so calls in the wrong format aren't
accidentally reintroduced.

Signed-off-by: Alper Nebi Yasak &lt;alpernebiyasak@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: Don't allow common.h and dm.h in headers</title>
<updated>2020-08-04T02:19:54Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-07-19T16:16:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=23552ba142860205c4ddec414417cdc251f8cb79'/>
<id>urn:sha1:23552ba142860205c4ddec414417cdc251f8cb79</id>
<content type='text'>
These headers should not be included in other header files. Add a
checkpatch rule and test for this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Fix up the test comments</title>
<updated>2020-08-04T02:19:54Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-07-19T16:16:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4620d46bf0aa00df3857a5883b790da3d12995dd'/>
<id>urn:sha1:4620d46bf0aa00df3857a5883b790da3d12995dd</id>
<content type='text'>
Many of the tests have the same comment and two have the same name. Fix
this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>checkpatch: Don't warn about PREFER_IF in headers/DT files</title>
<updated>2020-07-10T00:57:22Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-06-14T16:54:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8af45b1f20f7f56a872297873f793655fe37f8e3'/>
<id>urn:sha1:8af45b1f20f7f56a872297873f793655fe37f8e3</id>
<content type='text'>
This warning should only be displayed for C files. Fix it and update the
test.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Add tests for the rest of the checkpatch checks</title>
<updated>2020-07-10T00:57:22Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-06-14T16:54:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5c430761e6a618032498fe294376a15a7ed1ee0b'/>
<id>urn:sha1:5c430761e6a618032498fe294376a15a7ed1ee0b</id>
<content type='text'>
Finish off the tests for our small collection of checkpatch checks.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Decode output from the '--show-types' option</title>
<updated>2020-07-10T00:57:22Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-06-14T16:54:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=89fb8b75bce61c53867f80392cdef9cfc5dbc9cd'/>
<id>urn:sha1:89fb8b75bce61c53867f80392cdef9cfc5dbc9cd</id>
<content type='text'>
Collect the 'checkpatch type' from each error, warning and check. Provide
this to patman and update the uclass test to use it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>patman: Add a test for the 'possible new uclass' check</title>
<updated>2020-07-10T00:57:22Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-06-14T16:54:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4148c20f533d908a4255c134601b335322a0d38f'/>
<id>urn:sha1:4148c20f533d908a4255c134601b335322a0d38f</id>
<content type='text'>
It is quite likely that the number of U-Boot-specific tests in
checkpatch.pl will increase over time. We should have tests for these to
avoid undefined behaviour and bugs being introduced, which might cause
people to ignore the warnings.

Add a simple new class that can generate a patch with a single-line
addition in it. Use that to add a test for one of the checkpatch checks.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
</feed>
