]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: seq: Drop superfluous error/debug messages after malloc failures
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Mar 2015 14:41:18 +0000 (15:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 10 Mar 2015 14:41:18 +0000 (15:41 +0100)
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>
sound/core/seq/seq_fifo.c
sound/core/seq/seq_memory.c
sound/core/seq/seq_ports.c
sound/core/seq/seq_prioq.c
sound/core/seq/seq_queue.c
sound/core/seq/seq_timer.c

index 53a403e17c5bba08a755da454dfee3d5829c2cc9..1d5acbe0c08bdf14db4253f95391fa5e99059610 100644 (file)
@@ -33,10 +33,8 @@ struct snd_seq_fifo *snd_seq_fifo_new(int poolsize)
        struct snd_seq_fifo *f;
 
        f = kzalloc(sizeof(*f), GFP_KERNEL);
-       if (f == NULL) {
-               pr_debug("ALSA: seq: malloc failed for snd_seq_fifo_new() \n");
+       if (!f)
                return NULL;
-       }
 
        f->pool = snd_seq_pool_new(poolsize);
        if (f->pool == NULL) {
index ba8e4a64e13ee3106ce3f75b693a1f3775e73205..801076687bb16f082a8780125c69e879bdef4019 100644 (file)
@@ -387,10 +387,8 @@ int snd_seq_pool_init(struct snd_seq_pool *pool)
                return 0;
 
        pool->ptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size);
-       if (pool->ptr == NULL) {
-               pr_debug("ALSA: seq: malloc for sequencer events failed\n");
+       if (!pool->ptr)
                return -ENOMEM;
-       }
 
        /* add new cells to the free cell list */
        spin_lock_irqsave(&pool->lock, flags);
@@ -463,10 +461,8 @@ struct snd_seq_pool *snd_seq_pool_new(int poolsize)
 
        /* create pool block */
        pool = kzalloc(sizeof(*pool), GFP_KERNEL);
-       if (pool == NULL) {
-               pr_debug("ALSA: seq: malloc failed for pool\n");
+       if (!pool)
                return NULL;
-       }
        spin_lock_init(&pool->lock);
        pool->ptr = NULL;
        pool->free = NULL;
index 46ff593f618dc0b75ea66f886e051c035f2aebad..55170a20ae7237246f5560e14c5b5066bb52ba35 100644 (file)
@@ -141,10 +141,8 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
 
        /* create a new port */
        new_port = kzalloc(sizeof(*new_port), GFP_KERNEL);
-       if (! new_port) {
-               pr_debug("ALSA: seq: malloc failed for registering client port\n");
+       if (!new_port)
                return NULL;    /* failure, out of memory */
-       }
        /* init port data */
        new_port->addr.client = client->number;
        new_port->addr.port = -1;
index 021b02bc9330f5770fa2ef0072ed844de25b677a..bc1c8488fc2a1508d9572617e9030ba180477fd0 100644 (file)
@@ -59,10 +59,8 @@ struct snd_seq_prioq *snd_seq_prioq_new(void)
        struct snd_seq_prioq *f;
 
        f = kzalloc(sizeof(*f), GFP_KERNEL);
-       if (f == NULL) {
-               pr_debug("ALSA: seq: malloc failed for snd_seq_prioq_new()\n");
+       if (!f)
                return NULL;
-       }
        
        spin_lock_init(&f->lock);
        f->head = NULL;
index aad4878cee5579f2556524db0f61a069cc07fef5..a0cda38205b9760bc6e1d1943c8f1deb05ded567 100644 (file)
@@ -111,10 +111,8 @@ static struct snd_seq_queue *queue_new(int owner, int locked)
        struct snd_seq_queue *q;
 
        q = kzalloc(sizeof(*q), GFP_KERNEL);
-       if (q == NULL) {
-               pr_debug("ALSA: seq: malloc failed for snd_seq_queue_new()\n");
+       if (!q)
                return NULL;
-       }
 
        spin_lock_init(&q->owner_lock);
        spin_lock_init(&q->check_lock);
index e73605393eee5351bed9d4472150fd0b63335e5d..186f1611103c5279408c3fa605f62a89f28d537f 100644 (file)
@@ -56,10 +56,8 @@ struct snd_seq_timer *snd_seq_timer_new(void)
        struct snd_seq_timer *tmr;
        
        tmr = kzalloc(sizeof(*tmr), GFP_KERNEL);
-       if (tmr == NULL) {
-               pr_debug("ALSA: seq: malloc failed for snd_seq_timer_new() \n");
+       if (!tmr)
                return NULL;
-       }
        spin_lock_init(&tmr->lock);
 
        /* reset setup to defaults */