Differences

This shows you the differences between two versions of the page.

Link to this comparison view

so2:upstream [2017/02/24 21:43]
daniel.baluta
so2:upstream [2017/02/24 22:34] (current)
daniel.baluta
Line 83: Line 83:
  
  
 +===== Finding things to fix =====
 +
 +==== scripts/​checkpatch.pl ====
 +
 +This tools checks for coding style violations. Please keep in mind that:
 +    * this tool can report false positives. Errors or warnings which are tolerated for old code in the kernel.
 +    * except for ''​drivers/​staging''​ directory most of the maintainers are reluctant to coding style fixes.
 +
 +<​code>​
 +$ $ ./​scripts/​checkpatch.pl --strict -f drivers/​staging/​greybus/​pwm.c
 +CHECK: Please don't use multiple blank lines
 +#28: FILE: drivers/​staging/​greybus/​pwm.c:​28:​
 ++
 ++
 +</​code>​
 +Now edit ''​drivers/​staging/​greybus/​pwm.c''​ and remove the extra blank line.
 +
 +==== Fix the code and submit the patch ====
 +
 +After you fix the code you can use git to see the difference between initial file version.
 +<​code>​
 +
 +$ git diff
 +diff --git a/​drivers/​staging/​greybus/​pwm.c b/​drivers/​staging/​greybus/​pwm.c
 +index c4bf329..ab72c9e 100644
 +--- a/​drivers/​staging/​greybus/​pwm.c
 ++++ b/​drivers/​staging/​greybus/​pwm.c
 +@@ -25,7 +25,6 @@ struct gb_pwm_chip {
 + #​define pwm_chip_to_gb_pwm_chip(chip) \
 +        container_of(chip,​ struct gb_pwm_chip,​ chip)
 + 
 +-
 + ​static int gb_pwm_count_operation(struct gb_pwm_chip *pwmc)
 + {
 +        struct gb_pwm_count_response response;
 +
 +</​code>​
 +
 +<​code>​
 +
 +$ git status
 +On branch staging-testing
 +Your branch is up-to-date with '​origin/​staging-testing'​.
 +Changes not staged for commit:
 +  (use "git add <​file>​..."​ to update what will be committed)
 +  (use "git checkout -- <​file>​..."​ to discard changes in working directory)
 +
 + modified: ​  ​drivers/​staging/​greybus/​pwm.c
 +
 +</​code>​
 +
 +==== Create the commit ====
 +Now it's time to create the commit, make sure you add a proper commit message:
 +
 +<​code>​
 +$ git commit -s
 +
 +    greybus: pwm: Remove extra blank line
 +    ​
 +    This was reported by checkpatch.pl
 +    ​
 +    Signed-off-by:​ Daniel Baluta <​daniel.baluta@gmail.com>​
 +
 +</​code>​
 +
 +==== Create the patch =====
 +
 +<​code>​
 +
 +$ git format-patch -1
 +0001-greybus-pwm-Remove-extra-blank-line.patch
 +
 +</​code>​
 +
 +
 +==== Where to send the patch ====
 +
 +<​code>​
 +
 +$ ./​scripts/​get_maintainer.pl 0001-greybus-pwm-Remove-extra-blank-line.patch ​
 +M1 (maintainer:​GREYBUS SUBSYSTEM)
 +M2 (maintainer:​GREYBUS SUBSYSTEM)
 +M3 (maintainer:​GREYBUS SUBSYSTEM)
 +L1 (open list:​GREYBUS SUBSYSTEM)
 +L2 (open list:​STAGING SUBSYSTEM)
 +L3 (open list)
 +
 +</​code>​
 +
 +==== Send the patch ====
 +<​code>​
 +$ git send-email --to=<​maintainer1>​ --to=<​maintainer2>​ --cc=<​list1>​ --cc=<​list2>​ 0001-greybus-pwm-Remove-extra-blank-line.patch
 +</​code>​
 +
 +===== sparse =====
 +
 +   * make C=1 path/​to/​file
 +
 +
 +===== coccinelle =====
 +
 +   * see [[https://​www.kernel.org/​doc/​html/​latest/​dev-tools/​coccinelle.html | Coccinelle documentation]]
so2/upstream.1487965385.txt.gz · Last modified: 2017/02/24 21:43 by daniel.baluta
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0