#!/bin/bash

# Usage: run-checkpatch <subdir>
# Run the checkpatch.pl kernel script on the given subdirectory
# Run this in a toplevel kernel directory

FLIST=`find $1 | grep "\.[ch]$" `

checkpatch="./scripts/checkpatch.pl --strict --quiet --file "

echo "Running checkpatch.pl on sources files in $1"

for f in $FLIST
do
  file=$f
  echo ===========================================
  echo "Checking $file..."
  $checkpatch $file
done

