Commit 66b8206b authored by Linus Torvalds's avatar Linus Torvalds

Fix various sound compiler warnings (and outright bugs

on non-x86 architectures)
parent 6406b41a
...@@ -345,7 +345,7 @@ void snd_printd(const char *format, ...); ...@@ -345,7 +345,7 @@ void snd_printd(const char *format, ...);
#else /* !CONFIG_SND_DEBUG */ #else /* !CONFIG_SND_DEBUG */
#define snd_printd(fmt, args...) /* nothing */ #define snd_printd(fmt, args...) /* nothing */
#define snd_assert(expr, args...) /* nothing */ #define snd_assert(expr, args...) (void)(expr)
#define snd_runtime_check(expr, args...) do { if (!(expr)) { args; } } while (0) #define snd_runtime_check(expr, args...) do { if (!(expr)) { args; } } while (0)
#endif /* CONFIG_SND_DEBUG */ #endif /* CONFIG_SND_DEBUG */
......
...@@ -38,7 +38,7 @@ extern int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, ...@@ -38,7 +38,7 @@ extern int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params,
/* To share the same code we have alsa-lib */ /* To share the same code we have alsa-lib */
#define snd_mask_bits(mask) (*(mask)) #define snd_mask_bits(mask) (*(mask))
#define INLINE static inline #define INLINE static inline
#define assert(a) #define assert(a) (void)(a)
INLINE unsigned int ld2(u_int32_t v) INLINE unsigned int ld2(u_int32_t v)
{ {
......
...@@ -143,7 +143,7 @@ int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream) ...@@ -143,7 +143,7 @@ int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream)
break; break;
} }
if (runtime->avail < runtime->buffer_size && !timeout) { if (runtime->avail < runtime->buffer_size && !timeout) {
snd_printk(KERN_WARNING "rawmidi drain error (avail = %li, buffer_size = %li)\n", runtime->avail, runtime->buffer_size); snd_printk(KERN_WARNING "rawmidi drain error (avail = %i, buffer_size = %i)\n", runtime->avail, runtime->buffer_size);
err = -EIO; err = -EIO;
break; break;
} }
......
...@@ -469,7 +469,7 @@ static client_t *get_event_dest_client(snd_seq_event_t *event, int filter) ...@@ -469,7 +469,7 @@ static client_t *get_event_dest_client(snd_seq_event_t *event, int filter)
if (! dest->accept_input) if (! dest->accept_input)
goto __not_avail; goto __not_avail;
if ((dest->filter & SNDRV_SEQ_FILTER_USE_EVENT) && if ((dest->filter & SNDRV_SEQ_FILTER_USE_EVENT) &&
! test_bit(event->type, &dest->event_filter)) ! test_bit(event->type, dest->event_filter))
goto __not_avail; goto __not_avail;
if (filter && !(dest->filter & filter)) if (filter && !(dest->filter & filter))
goto __not_avail; goto __not_avail;
......
...@@ -53,8 +53,8 @@ struct _snd_seq_client { ...@@ -53,8 +53,8 @@ struct _snd_seq_client {
char name[64]; /* client name */ char name[64]; /* client name */
int number; /* client number */ int number; /* client number */
unsigned int filter; /* filter flags */ unsigned int filter; /* filter flags */
unsigned char client_filter[32]; bitmap_member(client_filter, 256);
unsigned char event_filter[32]; bitmap_member(event_filter, 256);
snd_use_lock_t use_lock; snd_use_lock_t use_lock;
int event_lost; int event_lost;
/* ports */ /* ports */
......
...@@ -544,10 +544,10 @@ int snd_seq_queue_use(int queueid, int client, int use) ...@@ -544,10 +544,10 @@ int snd_seq_queue_use(int queueid, int client, int use)
return -EINVAL; return -EINVAL;
down(&queue->timer_mutex); down(&queue->timer_mutex);
if (use) { if (use) {
if (!test_and_set_bit(client, &queue->clients_bitmap)) if (!test_and_set_bit(client, queue->clients_bitmap))
queue->clients++; queue->clients++;
} else { } else {
if (test_and_clear_bit(client, &queue->clients_bitmap)) if (test_and_clear_bit(client, queue->clients_bitmap))
queue->clients--; queue->clients--;
} }
if (queue->clients) { if (queue->clients) {
...@@ -575,7 +575,7 @@ int snd_seq_queue_is_used(int queueid, int client) ...@@ -575,7 +575,7 @@ int snd_seq_queue_is_used(int queueid, int client)
q = queueptr(queueid); q = queueptr(queueid);
if (q == NULL) if (q == NULL)
return -EINVAL; /* invalid queue */ return -EINVAL; /* invalid queue */
result = test_bit(client, &q->clients_bitmap) ? 1 : 0; result = test_bit(client, q->clients_bitmap) ? 1 : 0;
queuefree(q); queuefree(q);
return result; return result;
} }
......
...@@ -51,7 +51,7 @@ struct _snd_seq_queue { ...@@ -51,7 +51,7 @@ struct _snd_seq_queue {
spinlock_t check_lock; spinlock_t check_lock;
/* clients which uses this queue (bitmap) */ /* clients which uses this queue (bitmap) */
unsigned int clients_bitmap[SNDRV_SEQ_MAX_CLIENTS/sizeof(unsigned long)]; bitmap_member(clients_bitmap,SNDRV_SEQ_MAX_CLIENTS);
unsigned int clients; /* users of this queue */ unsigned int clients; /* users of this queue */
struct semaphore timer_mutex; struct semaphore timer_mutex;
......
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