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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3DFC9C2D0A3 for ; Tue, 3 Nov 2020 20:17:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0191522226 for ; Tue, 3 Nov 2020 20:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729272AbgKCURN (ORCPT ); Tue, 3 Nov 2020 15:17:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:60814 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgKCURN (ORCPT ); Tue, 3 Nov 2020 15:17:13 -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 C2345AC77; Tue, 3 Nov 2020 20:17:11 +0000 (UTC) Date: Tue, 03 Nov 2020 21:17:11 +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 dead code In-Reply-To: References: <20201102071154.23563-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=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 03 Nov 2020 19:43:55 +0100, Yu Hao wrote: > > Yes, I can do that. > > And a quick question, to resubmit with that change means that I should create > a new submission and this one ends, right? Yes, just submit a fresh patch. thanks, Takashi > > Thanks. > > On Tue, Nov 3, 2020 at 5:09 AM Takashi Iwai wrote: > > On Mon, 02 Nov 2020 08:11:54 +0100, > Yu Hao wrote: > > > > The function snd_seq_queue_client_termination() is only called from > > function seq_free_client1(). The seq_free_client1() calls function > > snd_seq_queue_client_leave(), which deletes all objects whose owner > > equals to client->number in global array queue_list, before the function > > snd_seq_queue_client_termination(), which checks whether there are > > any objects in global array queue_list whose owner equals to > > client->number, with the same argument client->number. So > > the checking code in function snd_seq_queue_client_termination() is > > dead code. Remove those dead code. > > > > Signed-off-by: Yu Hao > > Actually the whole function snd_seq_queue_client_termination() can be > removed.  It's a quite old code and I don't remember clearly, but I > guess the intention was to call this before the actual queue > deletion.  OTOH, it doesn't make any sense to change that order any > longer, as the snd_seq_queue_client_leave() already takes similar > procedure anyway, so let's rather wipe off the useless function. > > Could you resubmit with that change? > > thanks, > > Takashi > > > --- > >  sound/core/seq/seq_queue.c | 11 ----------- > >  1 file changed, 11 deletions(-) > > > > diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c > > index 71a6ea62c3be..91b3f3295d0b 100644 > > --- a/sound/core/seq/seq_queue.c > > +++ b/sound/core/seq/seq_queue.c > > @@ -545,21 +545,10 @@ 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); > >       } > >  } > > -- > > 2.17.1 > > > >