RFC: currently unconditionally, but this may need to be changed because
so many patches are not passing this check. Even upstream backports
from Linus Torvalds are failing the check sometimes.

This is test is important to keep all kernel patches in upstreamable state.
It would help keeping BSP and project specific kernel recipes in better shape.
It will not help if BSP git trees contain 1000's of non-upstreamed
patches. Passing this script is mandatory for patches according to
https://www.kernel.org/doc/html/latest/process/submit-checklist.html

checkpatch.pl catches for example:

 * missing Signed-off-by lines
 * spaces vs. tabs indents, new line issues etc coding style issues
 * some bugs like useless initialization of global variables

Signed-off-by: Mikko Rapeli <[email protected]>
---
 meta/classes/kernel.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a724645466..b0c0359d38 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -547,6 +547,15 @@ do_savedefconfig() {
 do_savedefconfig[nostamp] = "1"
 addtask savedefconfig after do_configure
 
+do_checkpatch() {
+       bbplain "Running checkpatch.pl QA check for all kernel patches"
+       if ls "${S}"/patches/*.patch > /dev/null; then
+               "${S}/scripts/checkpatch.pl" "${S}"/patches/*.patch
+       fi
+}
+do_checkpatch[nostamp] = "1"
+addtask checkpatch after do_configure
+
 inherit cml1
 
 KCONFIG_CONFIG_COMMAND_append = " HOSTLDFLAGS='${BUILD_LDFLAGS}'"
-- 
2.23.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#137269): 
https://lists.openembedded.org/g/openembedded-core/message/137269
Mute This Topic: https://lists.openembedded.org/mt/73075458/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to