Re: [Final call for testers][PATCH] superblock handling changes (2.4.6-pre3)

From: Linus Torvalds (torvalds@transmeta.com)
Date: Fri Jun 15 2001 - 14:12:02 EST


On Fri, 15 Jun 2001, Alexander Viro wrote:
> > > + list_add (&s->s_list, super_blocks.prev);
> >
> > I'd use list_add_tail(&s->s_list, super_blocks);
>
> Umm... Why?

I have to agree with Matthew - "list_add_tail()" more clearly says what
the code is trying to do.

Aside from that, I will bet you a dollar that you'll see that using
"list_add_tail()" generating better code. Why? Simply because that way one
of the pointers is a constant, instead of being through indirection. Try
it and see.

And if order is arbitrary, please just use

        list_add(&s->s_list, super_blocks);

because otherwise why use the ".prev" at all?

                Linus

-
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/



This archive was generated by hypermail 2b29 : Fri Jun 15 2001 - 21:00:25 EST