ALSA: seq: Drop superfluous error/debug messages after malloc failures
The kernel memory allocators already report the errors when the requested allocation fails, thus we don't need to warn it again in each caller side. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Родитель
8d98a0673f
Коммит
24db8bbaa3
|
@ -33,10 +33,8 @@ struct snd_seq_fifo *snd_seq_fifo_new(int poolsize)
|
||||||
struct snd_seq_fifo *f;
|
struct snd_seq_fifo *f;
|
||||||
|
|
||||||
f = kzalloc(sizeof(*f), GFP_KERNEL);
|
f = kzalloc(sizeof(*f), GFP_KERNEL);
|
||||||
if (f == NULL) {
|
if (!f)
|
||||||
pr_debug("ALSA: seq: malloc failed for snd_seq_fifo_new() \n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
f->pool = snd_seq_pool_new(poolsize);
|
f->pool = snd_seq_pool_new(poolsize);
|
||||||
if (f->pool == NULL) {
|
if (f->pool == NULL) {
|
||||||
|
|
|
@ -387,10 +387,8 @@ int snd_seq_pool_init(struct snd_seq_pool *pool)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pool->ptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size);
|
pool->ptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size);
|
||||||
if (pool->ptr == NULL) {
|
if (!pool->ptr)
|
||||||
pr_debug("ALSA: seq: malloc for sequencer events failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/* add new cells to the free cell list */
|
/* add new cells to the free cell list */
|
||||||
spin_lock_irqsave(&pool->lock, flags);
|
spin_lock_irqsave(&pool->lock, flags);
|
||||||
|
@ -463,10 +461,8 @@ struct snd_seq_pool *snd_seq_pool_new(int poolsize)
|
||||||
|
|
||||||
/* create pool block */
|
/* create pool block */
|
||||||
pool = kzalloc(sizeof(*pool), GFP_KERNEL);
|
pool = kzalloc(sizeof(*pool), GFP_KERNEL);
|
||||||
if (pool == NULL) {
|
if (!pool)
|
||||||
pr_debug("ALSA: seq: malloc failed for pool\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
spin_lock_init(&pool->lock);
|
spin_lock_init(&pool->lock);
|
||||||
pool->ptr = NULL;
|
pool->ptr = NULL;
|
||||||
pool->free = NULL;
|
pool->free = NULL;
|
||||||
|
|
|
@ -141,10 +141,8 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
|
||||||
|
|
||||||
/* create a new port */
|
/* create a new port */
|
||||||
new_port = kzalloc(sizeof(*new_port), GFP_KERNEL);
|
new_port = kzalloc(sizeof(*new_port), GFP_KERNEL);
|
||||||
if (! new_port) {
|
if (!new_port)
|
||||||
pr_debug("ALSA: seq: malloc failed for registering client port\n");
|
|
||||||
return NULL; /* failure, out of memory */
|
return NULL; /* failure, out of memory */
|
||||||
}
|
|
||||||
/* init port data */
|
/* init port data */
|
||||||
new_port->addr.client = client->number;
|
new_port->addr.client = client->number;
|
||||||
new_port->addr.port = -1;
|
new_port->addr.port = -1;
|
||||||
|
|
|
@ -59,10 +59,8 @@ struct snd_seq_prioq *snd_seq_prioq_new(void)
|
||||||
struct snd_seq_prioq *f;
|
struct snd_seq_prioq *f;
|
||||||
|
|
||||||
f = kzalloc(sizeof(*f), GFP_KERNEL);
|
f = kzalloc(sizeof(*f), GFP_KERNEL);
|
||||||
if (f == NULL) {
|
if (!f)
|
||||||
pr_debug("ALSA: seq: malloc failed for snd_seq_prioq_new()\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
spin_lock_init(&f->lock);
|
spin_lock_init(&f->lock);
|
||||||
f->head = NULL;
|
f->head = NULL;
|
||||||
|
|
|
@ -111,10 +111,8 @@ static struct snd_seq_queue *queue_new(int owner, int locked)
|
||||||
struct snd_seq_queue *q;
|
struct snd_seq_queue *q;
|
||||||
|
|
||||||
q = kzalloc(sizeof(*q), GFP_KERNEL);
|
q = kzalloc(sizeof(*q), GFP_KERNEL);
|
||||||
if (q == NULL) {
|
if (!q)
|
||||||
pr_debug("ALSA: seq: malloc failed for snd_seq_queue_new()\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
spin_lock_init(&q->owner_lock);
|
spin_lock_init(&q->owner_lock);
|
||||||
spin_lock_init(&q->check_lock);
|
spin_lock_init(&q->check_lock);
|
||||||
|
|
|
@ -56,10 +56,8 @@ struct snd_seq_timer *snd_seq_timer_new(void)
|
||||||
struct snd_seq_timer *tmr;
|
struct snd_seq_timer *tmr;
|
||||||
|
|
||||||
tmr = kzalloc(sizeof(*tmr), GFP_KERNEL);
|
tmr = kzalloc(sizeof(*tmr), GFP_KERNEL);
|
||||||
if (tmr == NULL) {
|
if (!tmr)
|
||||||
pr_debug("ALSA: seq: malloc failed for snd_seq_timer_new() \n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
spin_lock_init(&tmr->lock);
|
spin_lock_init(&tmr->lock);
|
||||||
|
|
||||||
/* reset setup to defaults */
|
/* reset setup to defaults */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче