cleaned up the code a little using the linux kernel checkpatch.pl tool