All of lore.kernel.org
 help / color / mirror / Atom feed
* sg_is_chain() call in coh901318_lli_fill_sg()
@ 2013-02-04 11:33 Bart Van Assche
  2013-02-19 12:05 ` Per Forlin
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2013-02-04 11:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

I'm trying to understand how coh901318_lli_fill_sg() works by studying 
the source code of that function. In that function I found the following 
code:

	for_each_sg(sgl, sg, nents, i) {
		if (sg_is_chain(sg)) {
			[ ... ]

Can anyone explain me why that construct makes sense ? As far as I can 
see in lib/scatterlist.c sg_next() ensures that the for_each_sg() skips 
those elements for which sg_is_chain(sg) == true. Does that mean that 
sg_is_chain(sg) always evaluates to false in the above loop ?

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* sg_is_chain() call in coh901318_lli_fill_sg()
  2013-02-04 11:33 sg_is_chain() call in coh901318_lli_fill_sg() Bart Van Assche
@ 2013-02-19 12:05 ` Per Forlin
  0 siblings, 0 replies; 2+ messages in thread
From: Per Forlin @ 2013-02-19 12:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Bart,

On Mon, Feb 4, 2013 at 12:33 PM, Bart Van Assche <bvanassche@acm.org> wrote:
> Hello,
>
> I'm trying to understand how coh901318_lli_fill_sg() works by studying the
> source code of that function. In that function I found the following code:
>
>         for_each_sg(sgl, sg, nents, i) {
>                 if (sg_is_chain(sg)) {
>                         [ ... ]
>
> Can anyone explain me why that construct makes sense ?
I think the answer is: it doesn't make sense.

> As far as I can see
> in lib/scatterlist.c sg_next() ensures that the for_each_sg() skips those
> elements for which sg_is_chain(sg) == true. Does that mean that
> sg_is_chain(sg) always evaluates to false in the above loop ?
Yes, I agree. I'm guilt of adding this check a long time ago due to sg
misconceptions. Today I no longer recall what the misconception was.
Linus, you may remove this check.

Thanks for spotting this,
Per

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-19 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-04 11:33 sg_is_chain() call in coh901318_lli_fill_sg() Bart Van Assche
2013-02-19 12:05 ` Per Forlin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.