[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VcdYL1+Wfqdw7pV6farGBTj4CtjvvZ=HWXes4mRf8pJAg@mail.gmail.com>
Date: Mon, 16 Jan 2017 12:12:36 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>
Cc: Tvrtko Ursulin <tursulin@...ulin.net>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Intel-gfx@...ts.freedesktop.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
Subject: Re: [Intel-gfx] [PATCH v4] lib/scatterlist: Avoid potential
scatterlist entry overflow
On Mon, Jan 16, 2017 at 12:05 PM, Tvrtko Ursulin
<tvrtko.ursulin@...ux.intel.com> wrote:
>>>>> - for (i = 1; i < n_pages; ++i)
>>>>> + for (i = 1; i < n_pages; ++i) {
>>>> // Are compilers so stupid doing calculation per iteration in
>>>> for-conditional?
>>>> // for (i = 0; i + 1 < n_pages; i++) ?
>>> I didn't get what you meant here?
>> Why do we start from 1? I see here two micro (?) optimizations:
>> 1) starting from 1 on believe that compiler dumb enough to every time
>> do a calculation in condition;
> The existing code starts from 1 because the pfn condition looks up page i -
> 1. I don't feel there is a need to change that as well.
>> 2) ++i instead of i++, but this is just matter of style, it's not a c++.
> Note that I haven't changed the existing code in this respect. I am happy to
> change it though.
Yes, this is another story. Just a side note to existing code, indeed.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists