lkml.org 
[lkml]   [2006]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: list corruption on removal of snd_seq_dummy
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.

Dave

--
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 19:01    [W:0.040 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site