Travis now runs checkpatch.pl

Note that this implies:
- If checkpatch.pl fails, Travis results is now "failed". In such a case,
  it must be checked that
  - checkpatch.pl fails for good reason (GP CamelCase style for ex.)
  - all the compilations steps are fine
- Signing the commit is now mandatory
     git commit -s ...
- When pushing several commits on the same branch (same pull-request),
  checkpatch.pl is run only on the code differences given by the
  the last commit

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org>
Signed-off-by: Pascal Brand <pascal.brand@st.com>
diff --git a/.travis.yml b/.travis.yml
index b1a9b36..3565e54 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,14 +8,28 @@
   - sudo apt-get update -qq
   - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi
 
-# Download the arm compiler to use
 before_script:
+  # Store the home repository
+  - export MYHOME=$PWD
+
+  # Download the arm compiler to use
   - wget http://releases.linaro.org/14.05/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux.tar.xz
   - tar xvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux.tar.xz
   - export PATH=$PATH:$PWD/gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux/bin
 
+  # Download checkpatch.pl, emulating kernel root tree
+  - export DST_KERNEL=$PWD/linux && mkdir -p $DST_KERNEL/scripts
+  - cd $DST_KERNEL && touch COPYING CREDITS Kbuild MAINTAINERS Makefile README Documentation arch include drivers fs init ipc kernel lib
+  - cd $DST_KERNEL/scripts
+  - wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl && chmod a+x $DST_KERNEL/scripts/checkpatch.pl
+  - wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt
+  - cd $MYHOME
+
 # Several compilation options are checked
 script:
+  # Run checkpatch.pl
+  - git format-patch -1 --stdout | $DST_KERNEL/scripts/checkpatch.pl -
+
   # Orly2
   -                                  PLATFORM=stm       PLATFORM_FLAVOR=orly2   CROSS_PREFIX=arm-linux-gnueabihf  make -j8 all
   - CFG_TEE_CORE_LOG_LEVEL=5 DEBUG=1 PLATFORM=stm       PLATFORM_FLAVOR=orly2   CROSS_PREFIX=arm-linux-gnueabihf  make -j8 all