User Tools

Site Tools


en:developers:documentation:submittingpatches

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
en:developers:documentation:submittingpatches [2016/09/24 10:44]
Kalle Valo [Checking state of patches from patchwork] Finish a sentence
en:developers:documentation:submittingpatches [2017/05/26 05:48]
Kalle Valo Add frequent problem "Commit reference is wrong"
Line 1: Line 1:
- 
  
  
Line 29: Line 28:
 Cc: Driver maintainers,​ Other Developers</​code>​ Cc: Driver maintainers,​ Other Developers</​code>​
  
-Where [[en/​developers/​maintainers|Maintainers]] contains the list of maintainers for the piece of code you are patching. //Other Developers//​ in this case can be a list of developers who you think may like to review this patch or who changed the code you are working on recently. ​+Where [[en/​developers/​maintainers|Maintainers]] contains the list of maintainers ​and mailing lists for the piece of code you are patching. //Other Developers//​ in this case can be a list of developers ​(or mailing lists) ​who you think may like to review this patch or who changed the code you are working on recently. ​
  
 +Do note that drivers might have special requirements,​ the best is to check them from the corresponding wiki page. Here's a list for few of them:
  
 +  * [[en/​users/​drivers/​ath10k/​submittingpatches|ath10k]]
 ===== Checking state of patches from patchwork ===== ===== Checking state of patches from patchwork =====
  
-All wireless patches are tracked in [[https://​patchwork.kernel.org/​project/​linux-wireless/​list/​|linux-wireless patchwork project]]. From patchwork you can check the state of the patch and to whom it is assigned. Here's a quick link to see all the patches, no matter what's the state:+All wireless patches are tracked in [[https://​patchwork.kernel.org/​project/​linux-wireless/​list/​|linux-wireless patchwork project]] ​(only exception being ath10k which has its own [[https://​patchwork.kernel.org/​project/​ath10k/​list/?​state=*|ath10k patchwork project]]). From patchwork you can check the state of the patch and to whom it is assigned. Here's a quick link to see all the patches, no matter what's the state:
  
 [[https://​patchwork.kernel.org/​project/​linux-wireless/​list/?​state=*]] [[https://​patchwork.kernel.org/​project/​linux-wireless/​list/?​state=*]]
Line 53: Line 54:
   * **Not Applicable**:​ The patch is either not part of wireless subsystem or it will be applied via different trees (for example net-next or driver maintainer trees). The patch is considered as dropped from now on and needs to be resubmitted for the maintainer to reconsider it.   * **Not Applicable**:​ The patch is either not part of wireless subsystem or it will be applied via different trees (for example net-next or driver maintainer trees). The patch is considered as dropped from now on and needs to be resubmitted for the maintainer to reconsider it.
  
- +===== Subject =====
-===== Subject ​name =====+
  
 If what you are sending is a patch you can use a subject as follows: ​ If what you are sending is a patch you can use a subject as follows: ​
Line 131: Line 131:
  ​include/​net/​ieee80211_regdomains.h |  196 ++++++++  ​include/​net/​ieee80211_regdomains.h |  196 ++++++++
 ...</​code>​ ...</​code>​
-Please also read the [[https://​kernel.org/​doc/​Documentation/SubmittingPatches|official Linux SubmittingPatches]] documentation,​ especially ​Section 12 and the **Developer'​s Certificate of Origin**. Do not submit patches unless you have read, understood and agreed to the certificate. ​+Please also read the [[https://www.kernel.org/​doc/​html/latest/​process/​submitting-patches.html|official Linux SubmittingPatches]] documentation,​ especially the **[[https://​www.kernel.org/​doc/​html/​latest/​process/​submitting-patches.html#​sign-your-work-the-developer-s-certificate-of-origin|Developer'​s Certificate of Origin]]**. Do not submit patches unless you have read, understood and agreed to the certificate. ​
  
  
Line 213: Line 213:
 +/* +/*
 ... ETC ...</​code>​ ... ETC ...</​code>​
 +
 +===== Frequent problems in patch submissions =====
 +
 +==== Patch version missing ====
 +
 +If you send a new version of the patch or patchset you should always add a version number. The first version does not need to be shown but starting from second version the version number must be available:
 +
 +  [PATCH] ath10k: fix DMA allocation
 +  [PATCH v2] ath10k: fix DMA allocation
 +  [PATCH v3] ath10k: fix DMA allocation
 +  ...
 +  [PATCH v11] ath10k: fix DMA allocation
 +
 +You can add the version with switch ''​--subject-prefix'':​
 +  ​
 +  git format-patch --subject-prefix="​PATCH v2"
 +
 +==== Changelog missing ====
 +
 +When sending a new version of a patch or patchset you should **always** add a changelog so that maintainer can easily what has changed.
 +
 +If you have just one patch you can add the changelog after the ''​%%---%%''​ (three dashes) line.
 +
 +If you have multiples patches (called a patchset) add the changelog to the cover letter. You can create the cover letter with switch ''​--cover-letter'':​
 +
 +  git format-patch --subject-prefix="​PATCH v2" --cover-letter
 +  ​
 +==== Signed-off-by missing ====
 +
 +Read [[https://​www.kernel.org/​doc/​html/​latest/​process/​submitting-patches.html#​sign-your-work-the-developer-s-certificate-of-origin|Developer'​s Certificate of Origin]] and add Signed-off-by to the commit log.
 +
 +==== Format issues ====
 +
 +Patch is somehow whitespace damaged, for example tabs converted to spaces, extra new lines or other modifications which prevent applying the patch without manual fixing. Or the mail is in HTML format which most of the mailing lists even block silently.
 +
 +The best way to avoid all formatting issues is to use [[https://​www.kernel.org/​pub/​software/​scm/​git/​docs/​git-send-email.html|git send-email]]
 +
 +==== Fixes line is incorrect ====
 +
 +The correct format for the commit references in Fixes line is the 12 initial digits
 +of the SHA1_ID of the commit, followed by a space, followed by the
 +commit log message header line text enclosed in parentheses and
 +double quotes with no line breaks whatsoever.
 +
 +Example:
 +
 +  Fixes: c742e623e941 ("​mwifiex:​ sdio card reset enhancement"​)
 +
 +==== Commit reference is wrong ====
 +
 +The correct format for the commit references in commit logs is to start with the string "​commit",​ followed by a space, followed 12 initial digits
 +of the SHA1_ID of the commit, followed by a space and followed by the
 +commit log message header line text enclosed in parentheses.
 +
 +Example:
 +
 +<​code>​
 +commit f99a6abe59e096cc2c753e667c19f22022e3bef4
 +Author: Sara Sharon <​sara.sharon@intel.com>​
 +Date:   Sun Mar 5 18:35:02 2017 +0200
 +
 +    iwlwifi: mvm: memset binding before setting values
 +    ​
 +    The changes in commit 9415af7f306b ("​iwlwifi:​ mvm: support new binding
 +    API") assigned values that were later memset to 0.  Move the memset
 +    earlier.
 +    ​
 +    Fixes: 9415af7f306b ("​iwlwifi:​ mvm: support new binding API")
 +    Signed-off-by:​ Sara Sharon <​sara.sharon@intel.com>​
 +    Signed-off-by:​ Luca Coelho <​luciano.coelho@intel.com>​
 +</​code>​
 +
  
 ===== More patch work references ===== ===== More patch work references =====
Line 218: Line 290:
 Here is a list of links to help you write better patches ​ Here is a list of links to help you write better patches ​
  
-  * [[https://​www.kernel.org/​doc/​Documentation/SubmittingPatches|SubmittingPatches]]+  * [[https://​www.kernel.org/​doc/​html/latest/​process/​submitting-patches.html|SubmittingPatches]]
   * https://​kernelnewbies.org/​FirstKernelPatch   * https://​kernelnewbies.org/​FirstKernelPatch
   * [[http://​linux.yyz.us/​patch-format.html|http://​linux.yyz.us/​patch-format.html]] ​   * [[http://​linux.yyz.us/​patch-format.html|http://​linux.yyz.us/​patch-format.html]] ​
-  * [[http://userweb.kernel.org/​~akpm/​stuff/​tpp.txt|Andrew Morton'​s ''​The perfect patch''​]] ​+  * [[https://www.ozlabs.org/​~akpm/​stuff/​tpp.txt|Andrew Morton'​s ''​The perfect patch''​]] ​
en/developers/documentation/submittingpatches.txt · Last modified: 2024/05/17 14:52 by Kalle Valo