- switch lock_set_fmt() and unlock_set_fmt() from macros to inline
functions. Macros that call return() are EVIL.
- simplify lock_set_fmt() and implement it via test_and_set_bit() rather
than a spinlock protecting an int.
- fix a bug wherein we would do an up() on a semaphore that hasn't been
down()ed if a signal happened after timeout in trident_write().
- fix a bug where we would not release the open_sem on OOM.
- make the arguments for prog_dmabuf clearer (int -> enum), and add two
wrapper functions around it, one for record and one for playback.
- fix a bug where we would call VALIDATE_STATE after lock_kernel(). Since
VALIDATE_STATE does 'return' if validation fails, bad things can happen.
Thanks to Dawson Engler <engler@stanford.edu> and the Stanford checker for
spotting.
- remove the calls to lock_kernel() from trident_release() and
trident_mmap(). trident_release() appears to be covered by the open_sem,
and trident_mmap() is covered by state->sem.