From: per.lkml@gmail.com (Per Forlin)
To: linux-arm-kernel@lists.infradead.org
Subject: sg_is_chain() call in coh901318_lli_fill_sg()
Date: Tue, 19 Feb 2013 13:05:16 +0100 [thread overview]
Message-ID: <CAFEEs1ni5J8__q2FGi4QvbS6Sz_dWCk20O5S9AE0UNQhvULP9Q@mail.gmail.com> (raw)
In-Reply-To: <510F9C79.4090108@acm.org>
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
prev parent reply other threads:[~2013-02-19 12:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEEs1ni5J8__q2FGi4QvbS6Sz_dWCk20O5S9AE0UNQhvULP9Q@mail.gmail.com \
--to=per.lkml@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).