Re: list_entry() question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 19 Feb 2007, Arjan van de Ven wrote:

> 
> > I walk the list of work items for a controller, using list_for_each()
> > and then I get the struct work_item variable using
> > list_entry(cursor, struct work_item, list_item);
> 
> it's not an answer to your question, but have you looked at using
> list_for_each_entry() instead ? I like that one a lot, it just a far
> more natural iterator..

I havn't looked at it before, but I just replaced one
list_for_each()/list_entry() snippet with list_for_each_entry(), and
you're right - looks more natural and easier to use.

I'll be converting the rest of the code to use list_for_each_entry(),
after I test that my code actually works. :)

Thanks for the suggestion,

Srdjan

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux