Re: crap, i think LKD3 explains linked list head nodes incorrectly ...

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

 



Hi Robert,

On Sat, Nov 20, 2010 at 10:09 PM, Robert P. J. Day
<rpjday@xxxxxxxxxxxxxx> wrote:
...snip...
>  that also suggests that a passage on p. 91 of LKD3 is inaccurate,
> where it claims that "because the lists are circular, you can
> generally pass any element for head."  but that can't be right, since
> you must *always* keep track of the head node for any list, to avoid
> processing it normally.  if you simply drop someone into the middle of
> a circular, doubly-linked kernel list, there is no way that i can see
> to know which node in that list is the head node when you run across
> it during iteration.
>
>  does this make sense?

I concur.

And this is why routines like list_is_last need to be passed in the
node to test along with the head of the list.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

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