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

Fix various sound compiler warnings (and outright bugs

on non-x86 architectures)
parent 6406b41a
No related merge requests found
......@@ -345,7 +345,7 @@ void snd_printd(const char *format, ...);
#else /* !CONFIG_SND_DEBUG */
#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)
#endif /* CONFIG_SND_DEBUG */
......
......@@ -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 */
#define snd_mask_bits(mask) (*(mask))
#define INLINE static inline
#define assert(a)
#define assert(a) (void)(a)
INLINE unsigned int ld2(u_int32_t v)
{
......
......@@ -143,7 +143,7 @@ int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream)
break;
}
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;
break;
}
......
......@@ -469,7 +469,7 @@ static client_t *get_event_dest_client(snd_seq_event_t *event, int filter)
if (! dest->accept_input)
goto __not_avail;
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;
if (filter && !(dest->filter & filter))
goto __not_avail;
......
......@@ -53,8 +53,8 @@ struct _snd_seq_client {
char name[64]; /* client name */
int number; /* client number */
unsigned int filter; /* filter flags */
unsigned char client_filter[32];
unsigned char event_filter[32];
bitmap_member(client_filter, 256);
bitmap_member(event_filter, 256);
snd_use_lock_t use_lock;
int event_lost;
/* ports */
......
......@@ -544,10 +544,10 @@ int snd_seq_queue_use(int queueid, int client, int use)
return -EINVAL;
down(&queue->timer_mutex);
if (use) {
if (!test_and_set_bit(client, &queue->clients_bitmap))
if (!test_and_set_bit(client, queue->clients_bitmap))
queue->clients++;
} else {
if (test_and_clear_bit(client, &queue->clients_bitmap))
if (test_and_clear_bit(client, queue->clients_bitmap))
queue->clients--;
}
if (queue->clients) {
......@@ -575,7 +575,7 @@ int snd_seq_queue_is_used(int queueid, int client)
q = queueptr(queueid);
if (q == NULL)
return -EINVAL; /* invalid queue */
result = test_bit(client, &q->clients_bitmap) ? 1 : 0;
result = test_bit(client, q->clients_bitmap) ? 1 : 0;
queuefree(q);
return result;
}
......
......@@ -51,7 +51,7 @@ struct _snd_seq_queue {
spinlock_t check_lock;
/* 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 */
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