From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161218AbWF0RHf (ORCPT ); Tue, 27 Jun 2006 13:07:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161219AbWF0RHf (ORCPT ); Tue, 27 Jun 2006 13:07:35 -0400 Received: from ns1.suse.de ([195.135.220.2]:3291 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1161218AbWF0RHe (ORCPT ); Tue, 27 Jun 2006 13:07:34 -0400 Date: Tue, 27 Jun 2006 19:07:26 +0200 Message-ID: From: Takashi Iwai To: Dave Jones Cc: Chuck Ebbert <76306.1226@compuserve.com>, alsa-devel , linux-kernel Subject: Re: list corruption on removal of snd_seq_dummy In-Reply-To: <20060627165819.GC1280@redhat.com> References: <200606270808_MC3-1-C391-2F33@compuserve.com> <20060627165819.GC1280@redhat.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta25) (eggplant) (+CVS-20060326) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.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