From: Takashi Iwai Subject: Re: list corruption on removal of snd_seq_dummy Date: Tue, 27 Jun 2006 19:07:26 +0200 Message-ID: References: <200606270808_MC3-1-C391-2F33@compuserve.com> <20060627165819.GC1280@redhat.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060627165819.GC1280@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Dave Jones Cc: alsa-devel , linux-kernel , Chuck Ebbert <76306.1226@compuserve.com> List-Id: alsa-devel@alsa-project.org At Tue, 27 Jun 2006 12:58:19 -0400, Dave Jones wrote: > > On Tue, Jun 27, 2006 at 02:38:39PM +0200, Takashi Iwai wrote: > > > > No, list_move() can't move the whole elements without loop. > > > > > > > > A solution is > > > > > > > > list_add(B, A); > > > > list_del_init(A); > > > > > > > > (although this introduces a bit more code :) > > > > > > Shouldn't it be like this? > > > > > > ports_list_first = client->ports_list_head.next; > > > list_del_init(client->ports_list_head); > > > list_splice(ports_list_first, &deleted_list); > > > > This requires INIT_LIST_HEAD(&deleted_list) first, so obviously > > a longer code :) > > This is hardly a speed/size critical function. I'd go for readability > over cute hacks any day. Yeah, of course. The code was already fixed on ALSA tree to use standard macros. Takashi Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642