Use this command:

./tools/checkpatch.sh -g HEAD~...HEAD