[Intel-gfx] [PATCH 02/31] drm/i915: Prefer list_first_entry_or_null
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Mon Jul 25 10:01:06 UTC 2016
On ma, 2016-07-25 at 09:03 +0100, Chris Wilson wrote:
> On Mon, Jul 25, 2016 at 10:55:24AM +0300, Joonas Lahtinen wrote:
> >
> > On ma, 2016-07-25 at 08:44 +0100, Chris Wilson wrote:
> > >
> > > list_first_entry_or_null() can generate better code than using
> > > if (!list_empty()) {ptr = list_first_entry()) ..., so put it to use.
> > >
> > > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > It looks cleaner, not so sure of the code impact.
> After the patch I sent to linux-kernel@ to improve code gneration for
> list_first_entry_or_null() is applied we save a few bytes on each
> invocation.
Ok, I've not spotted those, but sounds good.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list