Commit 0d7bcc30 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] trident OSS sound driver fixes

From: Muli Ben-Yehuda <mulix@mulix.org>

- 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.

- s/TRUE/1/, s/FALSE/0/
parent cb2b15d1
This diff is collapsed.
......@@ -56,11 +56,6 @@
#define PCI_DEVICE_ID_ALI_1533 0x1533
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#define CHANNEL_REGS 5
#define CHANNEL_START 0xe0 // The first bytes of the contiguous register space.
......@@ -363,7 +358,7 @@ static inline unsigned ld2(unsigned int x)
#ifdef DEBUG
#define TRDBG(msg, args...) do { \
printk(KERN_DEBUG msg , ##args ); \
printk(DEBUG msg , ##args ); \
} while (0)
#else /* !defined(DEBUG) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment