sound/core/seq: remove useless function
PATCH 1/1 sound/core/seq: remove useless function
The function snd_seq_queue_client_termination() is only called from the function seq_free_client1(). The function seq_free_client1() calls the function snd_seq_queue_client_leave() and the function snd_seq_queue_client_termination() together. Because the function snd_seq_queue_client_leave() does all things, so the function snd_seq_queue_client_termination() is a useless function.
--- sound/core/seq/seq_clientmgr.c | 1 - sound/core/seq/seq_queue.c | 27 --------------------------- sound/core/seq/seq_queue.h | 3 --- 3 files changed, 31 deletions(-)
sound/core/seq/seq_clientmgr.c +0 -1
@@ -279,7 +279,6 @@ static int seq_free_client1(struct snd_seq_client *client)snd_seq_delete_all_ports (client);snd_seq_queue_client_leave (client->number);snd_use_lock_sync (&client->use_lock); -snd_seq_queue_client_termination (client->number);if (client->pool)snd_seq_pool_delete (&client->pool);spin_lock_irq (&clients_lock);
sound/core/seq/seq_queue.c +0 -27
@@ -537,33 +537,6 @@ int snd_seq_queue_is_used(int queueid, int client)/*----------------------------------------------------------------*/ -/* notification that client has left the system - -* stop the timer on all queues owned by this client -*/ -void snd_seq_queue_client_termination (int client) -{ -unsigned long flags; -int i; -struct snd_seq_queue *q; -bool matched; - -for (i =0 ; i <SNDRV_SEQ_MAX_QUEUES ; i++) { -if ((q =queueptr (i)) ==NULL ) -continue ; -spin_lock_irqsave (&q->owner_lock, flags); - matched = (q->owner == client); -if (matched) - q->klocked =1 ; -spin_unlock_irqrestore (&q->owner_lock, flags); -if (matched) { -if (q->timer->running) -snd_seq_timer_stop (q->timer); -snd_seq_timer_reset (q->timer); - } -queuefree (q); - } -} -/* final stage notification - * remove cells for no longer exist client (for non-owned queue) * or delete this queue (for owned queue)
sound/core/seq/seq_queue.h +0 -3
@@ -59,9 +59,6 @@ struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int f/* delete queue (destructor) */ int snd_seq_queue_delete (int client,int queueid); -/* notification that client has left the system */ -void snd_seq_queue_client_termination (int client); -/* final stage */ void snd_seq_queue_client_leave (int client);
Signature · 1 line
2.17.1
Quoted 7 lines · Yu Hao
The function
snd_seq_queue_client_termination()is only called from the functionseq_free_client1(). The functionseq_free_client1()calls the functionsnd_seq_queue_client_leave()and the functionsnd_seq_queue_client_termination()together. Because the functionsnd_seq_queue_client_leave()does all things, so the functionsnd_seq_queue_client_termination()is a useless function.
How poetic, rhymes awfully well :)
Quoted 1 line
Signed-off-by Yu Hao <[email protected]>
Applied now. Thanks!
Takashi
Quoted 72 lines
sound/core/seq/seq_clientmgr.c | 1 - sound/core/seq/seq_queue.c | 27 --------------------------- sound/core/seq/seq_queue.h | 3 --- 3 files changed, 31 deletions(-)sound/core/seq/seq_clientmgr.c +0
-1@@ -279,7 +279,6 @@ static int seq_free_client1(struct snd_seq_client *client)snd_seq_delete_all_ports (client);snd_seq_queue_client_leave (client->number);snd_use_lock_sync (&client->use_lock); -snd_seq_queue_client_termination (client->number);if (client->pool)snd_seq_pool_delete (&client->pool);spin_lock_irq (&clients_lock);sound/core/seq/seq_queue.c +0
-27@@ -537,33 +537,6 @@ int snd_seq_queue_is_used(int queueid, int client)/*----------------------------------------------------------------*/ -/* notification that client has left the system - -* stop the timer on all queues owned by this client -*/ -void snd_seq_queue_client_termination (int client) -{ -unsigned long flags; -int i; -struct snd_seq_queue *q; -bool matched; - -for (i =0 ; i <SNDRV_SEQ_MAX_QUEUES ; i++) { -if ((q =queueptr (i)) ==NULL ) -continue ; -spin_lock_irqsave (&q->owner_lock, flags); - matched = (q->owner == client); -if (matched) - q->klocked =1 ; -spin_unlock_irqrestore (&q->owner_lock, flags); -if (matched) { -if (q->timer->running) -snd_seq_timer_stop (q->timer); -snd_seq_timer_reset (q->timer); - } -queuefree (q); - } -} -/* final stage notification - * remove cells for no longer exist client (for non-owned queue) * or delete this queue (for owned queue) sound/core/seq/seq_queue.h +0
-3@@ -59,9 +59,6 @@ struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int f/* delete queue (destructor) */ int snd_seq_queue_delete (int client,int queueid); -/* notification that client has left the system */ -void snd_seq_queue_client_termination (int client); -/* final stage */ void snd_seq_queue_client_leave (int client);Signature · 1 line
2.17.1
Thanks!
Quoted 92 lines · Takashi Iwai
Quoted 7 lines · Yu Hao
The function
snd_seq_queue_client_termination()is only called from the functionseq_free_client1(). The functionseq_free_client1()calls the functionsnd_seq_queue_client_leave()and the functionsnd_seq_queue_client_termination()together. Because the functionsnd_seq_queue_client_leave()does all things, so the functionsnd_seq_queue_client_termination()is a useless function.How poetic, rhymes awfully well :)
Quoted 1 line
Signed-off-by Yu Hao <[email protected]>Applied now. Thanks!
Takashi
Quoted 72 lines
sound/core/seq/seq_clientmgr.c | 1 - sound/core/seq/seq_queue.c | 27 --------------------------- sound/core/seq/seq_queue.h | 3 --- 3 files changed, 31 deletions(-)sound/core/seq/seq_clientmgr.c +0
-1@@ -279,7 +279,6 @@ static int seq_free_client1(struct snd_seq_client *client)snd_seq_delete_all_ports (client);snd_seq_queue_client_leave (client->number);snd_use_lock_sync (&client->use_lock); -snd_seq_queue_client_termination (client->number);if (client->pool)snd_seq_pool_delete (&client->pool);spin_lock_irq (&clients_lock);sound/core/seq/seq_queue.c +0
-27@@ -537,33 +537,6 @@ int snd_seq_queue_is_used(int queueid, int client)/*----------------------------------------------------------------*/ -/* notification that client has left the system - -* stop the timer on all queues owned by this client -*/ -void snd_seq_queue_client_termination (int client) -{ -unsigned long flags; -int i; -struct snd_seq_queue *q; -bool matched; - -for (i =0 ; i <SNDRV_SEQ_MAX_QUEUES ; i++) { -if ((q =queueptr (i)) ==NULL ) -continue ; -spin_lock_irqsave (&q->owner_lock, flags); - matched = (q->owner == client); -if (matched) - q->klocked =1 ; -spin_unlock_irqrestore (&q->owner_lock, flags); -if (matched) { -if (q->timer->running) -snd_seq_timer_stop (q->timer); -snd_seq_timer_reset (q->timer); - } -queuefree (q); - } -} -/* final stage notification - * remove cells for no longer exist client (for non-owned queue) * or delete this queue (for owned queue) sound/core/seq/seq_queue.h +0
-4@@ -59,9 +59,6 @@ struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int f/* delete queue (destructor) */ int snd_seq_queue_delete (int client,int queueid); -/* notification that client has left the system */ -void snd_seq_queue_client_termination (int client); -/* final stage */ void snd_seq_queue_client_leave (int client); --2.17.1