http://www.tuxradar.com/content/newbies-guide-hacking-linux-kernel

Make patch:

diff   -uprN   linux-3.15.2  linux-3.15.2-dprio  > linux-3.15.2-dprio.patch

 

./mk-patch.sh   linux-3.15.2  dprio

 

git  diff  -p  --stat  <path1>  <path2>

Current fileset vs. last commit:

 

git  add --all  .

git  diff  -p  --stat  HEAD

 

Or:

 

./mk-patch-git.sh  3.10  3.10-mypatch

Various checks:

scripts/checkpatch.pl   [--strict | --subjective] ../xxx.patch

make EXTRA_CFLAGS=-W
sparse:  make C=2   [CF="
-D__CHECK_ENDIAN__"]   [dir]
make header_check
make checkstack
make namespacecheck

Rebasing:

./rebase.sh  3.10  3.10-mypatch  3.12  3.12-mypatch
./mk-patch-git  3.12  3.12-mypatch

Typically when posting the patch want to rebase it against the tip:

git  clone  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
rm  -rf  tip/.git
./rebase.sh  3.10  3.10-mypatch  tip  tip-mypatch
./mk-patch-git   tip  tip-mypatch

Test with:

CONFIG_LOCKDEP
CONFIG_DEBUG_PREEMPT
CONFIG_DEBUG_SLAB   or   SLUB_DEBUG_ON
CONFIG_ DEBUG_PAGEALLOC
CONFIG_ DEBUG_MUTEXES
CONFIG_ DEBUG_SPINLOCK
CONFIG_ DEBUG_ATOMIC_SLEEP
CONFIG_PROVE_RCU
CONFIG_DEBUG_OBJECTS_RCU_HEAD
CONFIG_PROVE_LOCKING
CONFIG_LOCK_ALLOC
CONFIG_DYNAMIC_DEBUG
CONFIG_DEBUG_OBJECTS
CONFIG_DEBUG_OBJECTS_WORK

Expensive:

CONFIG_DEBUG_OBJECTS_FREE
CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER

Test with:

CONFIG_PREEMPT_NONE
CONFIG_PREEMPT_VOLUNTARY
CONFIG_PREEMPT

In the former two cases may want to disable CONFIG_ DEBUG_ATOMIC_SLEEP,
since it enables CONFIG_PREEMPT_COUNT and changes behavior.

Git operations:

git  clone  source-repository-address

git  add  --all  .
git  status
git  commit  -m  "comment-text"
git  tag  -a  "tag-name"   -m  "comment-text"

<copy new files>

git  add  --all  .
git  status
git  commit  -m  "comment-text"
git  tag  -a  "tag-name"   -m  "comment-text"

git  log  -p  -1  --stat

git  push  origin  master