lkml.org 
[lkml]   [2007]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sg_next() for struct scatterlist is confusing
On Sat, 27 Oct 2007, Haavard Skinnemoen wrote:

> On Sat, 27 Oct 2007 07:39:40 -0400 (EDT)
> "Robert P. J. Day" <rpjday@crashcourse.ca> wrote:
>
> > note how the comment says that the next entry will "usually" be
> > sg+1, "but" not if it's actually a pointer.
> >
> > however, as i read the code above, sg is *always* incremented before
> > that testing. is that correct? am i just misreading something? or
> > could the comment have been a bit clearer?
>
> If it increments sg and finds a "chain" entry, it will follow it to
> the next sg array instead of just returning it. Which makes sense
> because the chain entry itself isn't a valid entry in the sg list.

yes, i finally twigged on that after a few more minutes. it, of
course, makes sense, but it sure doesn't match the comment that's at
the top of that file.

rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================
-
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: 2007-10-27 18:41    [W:0.048 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site