This hasn't been tested enought, but it seems to get really close.
It assumes that clang-format is in your patch.
Run
perl scripys/whitespace.pl FILENAME
and you'll get a diff of what it things is wrong with that file.
If you like what you see, simply pipe the output into patch -p0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>