Coding style
The best way to get acquainted with what we will be looking for in kernel patches is to
start with the kernel's own documentation:
Checkpatch
Running the kernel's checkpatch tool on all patches submitted to kernel baselines.
Assuming you have already committed your changes locally and your current directory
is the root of the kernel source tree, you can use the following command to run checkpatch locally:
"git format -patch HEAD~1 --stdout | ./scripts/checkpatch.pl "
Patch Serialization
patches are regularly broken up into smaller pieces and submitted in sequence.
to separate logical changes into single patches. Beyond the obvious of not submitting bug fixes and
new work in a single patch.
new work in a single patch.
Also note that to submit changes to defconfig or device tree files as a separate as well.
Commit Messages
In the extended part of the commit message provide as many details as are relevant.
If the reason why a change is being made is not obvious, use the commit message to
provide some background and reasoning. When writing commit message try to think of
the information you would want to know if you were looking back at the change several
months down the road.
provide some background and reasoning. When writing commit message try to think of
the information you would want to know if you were looking back at the change several
months down the road.
Commit message often includes a prefix that can be used to quickly identify
which kernel subsystem is being modified . e.g. arm, config, dts, platform ...
Using "git commit -s" to generate one Signed-off-by: Line .
A good guide for writing git commit messages can be found at :
Good_commit_messages
AngularJS Git Commit Message Conventions
5 Useful Tips For A Better Commit Message
thoughtbot git message
one thing one commit
1. easy to read
2. easy to cherry-pick
3. easy to code review
1. easy to read
2. easy to cherry-pick
3. easy to code review
Applying Patches
If the code is supplied as git formatter patch, please use
git am to apply the patch so that the original commit metadata (author, data, commit message, etc.) is preserved.
git am to apply the patch so that the original commit metadata (author, data, commit message, etc.) is preserved.
If the code is available in a third party git tree, you can pull the remote tree into your locally checked out tree and use git cherry‐pick to pick up the patch with the original commit metadata.
Git usage
See Wiki Git