From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DBA1C388F7 for ; Wed, 4 Nov 2020 08:16:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44E522067D for ; Wed, 4 Nov 2020 08:16:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728550AbgKDIQR (ORCPT ); Wed, 4 Nov 2020 03:16:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:34152 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbgKDIQQ (ORCPT ); Wed, 4 Nov 2020 03:16:16 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EC80DACF1; Wed, 4 Nov 2020 08:16:14 +0000 (UTC) Date: Wed, 04 Nov 2020 09:16:14 +0100 Message-ID: From: Takashi Iwai To: Yu Hao Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sound/core/seq: remove useless function In-Reply-To: <20201103223335.21831-1-yuhaobehappy@gmail.com> References: <20201103223335.21831-1-yuhaobehappy@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 03 Nov 2020 23:33:35 +0100, Yu Hao wrote: > > 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. How poetic, rhymes awfully well :) > Signed-off-by: Yu Hao Applied now. Thanks! Takashi > 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(-) > > diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c > index cc93157fa950..f9f2fea58b32 100644 > --- a/sound/core/seq/seq_clientmgr.c > +++ b/sound/core/seq/seq_clientmgr.c > @@ -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); > diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c > index 71a6ea62c3be..13cfc2d47fa7 100644 > --- a/sound/core/seq/seq_queue.c > +++ b/sound/core/seq/seq_queue.c > @@ -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) > diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h > index 9254c8dbe5e3..1c3a8d3254d9 100644 > --- a/sound/core/seq/seq_queue.h > +++ b/sound/core/seq/seq_queue.h > @@ -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 >