diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-03-10 10:41:18 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-03-10 10:41:18 -0400 |
commit | 24db8bbaa3fcfaf0c2faccbff5864b58088ac1f6 (patch) | |
tree | ab1e97ade094b0f661bf9aedc0c3aafb7cfab0cf | |
parent | 8d98a0673f761f9b7be51a293ca9142ec0c037ca (diff) |
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>
-rw-r--r-- | sound/core/seq/seq_fifo.c | 4 | ||||
-rw-r--r-- | sound/core/seq/seq_memory.c | 8 | ||||
-rw-r--r-- | sound/core/seq/seq_ports.c | 4 | ||||
-rw-r--r-- | sound/core/seq/seq_prioq.c | 4 | ||||
-rw-r--r-- | sound/core/seq/seq_queue.c | 4 | ||||
-rw-r--r-- | sound/core/seq/seq_timer.c | 4 |
6 files changed, 7 insertions, 21 deletions
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c index 53a403e17c5b..1d5acbe0c08b 100644 --- a/sound/core/seq/seq_fifo.c +++ b/sound/core/seq/seq_fifo.c | |||
@@ -33,10 +33,8 @@ struct snd_seq_fifo *snd_seq_fifo_new(int poolsize) | |||
33 | struct snd_seq_fifo *f; | 33 | struct snd_seq_fifo *f; |
34 | 34 | ||
35 | f = kzalloc(sizeof(*f), GFP_KERNEL); | 35 | f = kzalloc(sizeof(*f), GFP_KERNEL); |
36 | if (f == NULL) { | 36 | if (!f) |
37 | pr_debug("ALSA: seq: malloc failed for snd_seq_fifo_new() \n"); | ||
38 | return NULL; | 37 | return NULL; |
39 | } | ||
40 | 38 | ||
41 | f->pool = snd_seq_pool_new(poolsize); | 39 | f->pool = snd_seq_pool_new(poolsize); |
42 | if (f->pool == NULL) { | 40 | if (f->pool == NULL) { |
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index ba8e4a64e13e..801076687bb1 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c | |||
@@ -387,10 +387,8 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) | |||
387 | return 0; | 387 | return 0; |
388 | 388 | ||
389 | pool->ptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size); | 389 | pool->ptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size); |
390 | if (pool->ptr == NULL) { | 390 | if (!pool->ptr) |
391 | pr_debug("ALSA: seq: malloc for sequencer events failed\n"); | ||
392 | return -ENOMEM; | 391 | return -ENOMEM; |
393 | } | ||
394 | 392 | ||
395 | /* add new cells to the free cell list */ | 393 | /* add new cells to the free cell list */ |
396 | spin_lock_irqsave(&pool->lock, flags); | 394 | spin_lock_irqsave(&pool->lock, flags); |
@@ -463,10 +461,8 @@ struct snd_seq_pool *snd_seq_pool_new(int poolsize) | |||
463 | 461 | ||
464 | /* create pool block */ | 462 | /* create pool block */ |
465 | pool = kzalloc(sizeof(*pool), GFP_KERNEL); | 463 | pool = kzalloc(sizeof(*pool), GFP_KERNEL); |
466 | if (pool == NULL) { | 464 | if (!pool) |
467 | pr_debug("ALSA: seq: malloc failed for pool\n"); | ||
468 | return NULL; | 465 | return NULL; |
469 | } | ||
470 | spin_lock_init(&pool->lock); | 466 | spin_lock_init(&pool->lock); |
471 | pool->ptr = NULL; | 467 | pool->ptr = NULL; |
472 | pool->free = NULL; | 468 | pool->free = NULL; |
diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index 46ff593f618d..55170a20ae72 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c | |||
@@ -141,10 +141,8 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, | |||
141 | 141 | ||
142 | /* create a new port */ | 142 | /* create a new port */ |
143 | new_port = kzalloc(sizeof(*new_port), GFP_KERNEL); | 143 | new_port = kzalloc(sizeof(*new_port), GFP_KERNEL); |
144 | if (! new_port) { | 144 | if (!new_port) |
145 | pr_debug("ALSA: seq: malloc failed for registering client port\n"); | ||
146 | return NULL; /* failure, out of memory */ | 145 | return NULL; /* failure, out of memory */ |
147 | } | ||
148 | /* init port data */ | 146 | /* init port data */ |
149 | new_port->addr.client = client->number; | 147 | new_port->addr.client = client->number; |
150 | new_port->addr.port = -1; | 148 | new_port->addr.port = -1; |
diff --git a/sound/core/seq/seq_prioq.c b/sound/core/seq/seq_prioq.c index 021b02bc9330..bc1c8488fc2a 100644 --- a/sound/core/seq/seq_prioq.c +++ b/sound/core/seq/seq_prioq.c | |||
@@ -59,10 +59,8 @@ struct snd_seq_prioq *snd_seq_prioq_new(void) | |||
59 | struct snd_seq_prioq *f; | 59 | struct snd_seq_prioq *f; |
60 | 60 | ||
61 | f = kzalloc(sizeof(*f), GFP_KERNEL); | 61 | f = kzalloc(sizeof(*f), GFP_KERNEL); |
62 | if (f == NULL) { | 62 | if (!f) |
63 | pr_debug("ALSA: seq: malloc failed for snd_seq_prioq_new()\n"); | ||
64 | return NULL; | 63 | return NULL; |
65 | } | ||
66 | 64 | ||
67 | spin_lock_init(&f->lock); | 65 | spin_lock_init(&f->lock); |
68 | f->head = NULL; | 66 | f->head = NULL; |
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index aad4878cee55..a0cda38205b9 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c | |||
@@ -111,10 +111,8 @@ static struct snd_seq_queue *queue_new(int owner, int locked) | |||
111 | struct snd_seq_queue *q; | 111 | struct snd_seq_queue *q; |
112 | 112 | ||
113 | q = kzalloc(sizeof(*q), GFP_KERNEL); | 113 | q = kzalloc(sizeof(*q), GFP_KERNEL); |
114 | if (q == NULL) { | 114 | if (!q) |
115 | pr_debug("ALSA: seq: malloc failed for snd_seq_queue_new()\n"); | ||
116 | return NULL; | 115 | return NULL; |
117 | } | ||
118 | 116 | ||
119 | spin_lock_init(&q->owner_lock); | 117 | spin_lock_init(&q->owner_lock); |
120 | spin_lock_init(&q->check_lock); | 118 | spin_lock_init(&q->check_lock); |
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c index e73605393eee..186f1611103c 100644 --- a/sound/core/seq/seq_timer.c +++ b/sound/core/seq/seq_timer.c | |||
@@ -56,10 +56,8 @@ struct snd_seq_timer *snd_seq_timer_new(void) | |||
56 | struct snd_seq_timer *tmr; | 56 | struct snd_seq_timer *tmr; |
57 | 57 | ||
58 | tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); | 58 | tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); |
59 | if (tmr == NULL) { | 59 | if (!tmr) |
60 | pr_debug("ALSA: seq: malloc failed for snd_seq_timer_new() \n"); | ||
61 | return NULL; | 60 | return NULL; |
62 | } | ||
63 | spin_lock_init(&tmr->lock); | 61 | spin_lock_init(&tmr->lock); |
64 | 62 | ||
65 | /* reset setup to defaults */ | 63 | /* reset setup to defaults */ |